updated to new names/urls

This commit is contained in:
Jeffrey Paul 2020-02-25 07:51:22 -08:00
parent 65a8d8d082
commit 674215d0cc
9 changed files with 28 additions and 27 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
/ircd /sircd

View File

@ -1,28 +1,31 @@
VERSION := $(shell git rev-parse --short HEAD) VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
BUILDUSER := $(shell whoami) BUILDUSER := $(shell whoami)
BUILDHOST := $(shell hostname -s) BUILDHOST := $(shell hostname -s)
BUILDARCH := $(shell uname -m) BUILDARCH := $(shell uname -m)
GOLDFLAGS += -X main.Version=$(VERSION) GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST) GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH) GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
GOFLAGS = -ldflags "$(GOLDFLAGS)" GOFLAGS = -ldflags "$(GOLDFLAGS)"
FN := sircd
default: rundebug default: rundebug
rundebug: build rundebug: build
DEBUG=1 ./ircd DEBUG=1 ./$(FN)
run: build run: build
./ircd ./$(FN)
build: ./ircd build: $(FN)
./ircd: *.go */*.go go-get:
go build -o $@ $(GOFLAGS) . cd cmd/$(FN) && go get -v
./$(FN): */*.go cmd/*/*.go go-get
cd cmd/$(FN) && go build -o ../../$(FN) $(GOFLAGS) .
fmt: fmt:
go fmt *.go go fmt */*.go
go fmt sircd/*.go go fmt cmd/$(FN)/*.go

View File

@ -3,11 +3,10 @@ package main
import "os" import "os"
import "fmt" import "fmt"
import "github.com/sirupsen/logrus" import "github.com/sirupsen/logrus"
import "github.com/sneak/sircd/sircd" import "git.eeqj.de/sneak/sircd/irc"
import "github.com/spf13/viper" import "github.com/spf13/viper"
var Version string var Version string
var Buildtime string
var Builduser string var Builduser string
var Buildarch string var Buildarch string
@ -20,7 +19,6 @@ func main() {
c.SetDefault("admin", "webmaster@example.com") c.SetDefault("admin", "webmaster@example.com")
c.SetDefault("loglevel", "info") c.SetDefault("loglevel", "info")
c.SetDefault("version", Version) c.SetDefault("version", Version)
c.SetDefault("buildtime", Buildtime)
c.SetDefault("builduser", Builduser) c.SetDefault("builduser", Builduser)
c.SetDefault("buildarch", Buildarch) c.SetDefault("buildarch", Buildarch)
@ -53,7 +51,7 @@ func main() {
log.SetReportCaller(true) log.SetReportCaller(true)
} }
// instantiate server // instantiate server
s := sircd.New(c) s := irc.New(c)
// give it our logger // give it our logger
s.SetLogger(log) s.SetLogger(log)

View File

@ -1,4 +1,4 @@
package sircd package irc
import ( import (
"bytes" "bytes"
@ -110,7 +110,7 @@ func (c *ircClient) SendServerMessage(code uint16, params []string) bool {
} }
} }
sendstr := fmt.Sprintf(":%s %s %d", c.ServerName(), code, c.session.nick) sendstr := fmt.Sprintf(":%s %d %s", c.ServerName(), code, c.session.nick)
if len(p) > 0 { if len(p) > 0 {
sendstr = sendstr + " " + p sendstr = sendstr + " " + p
} }

View File

@ -1,4 +1,4 @@
package sircd package irc
func (s *ircd) processIRCMessage(m *ircMessage) { func (s *ircd) processIRCMessage(m *ircMessage) {
// FIXME put all of these in a map of string->function // FIXME put all of these in a map of string->function

View File

@ -1,4 +1,4 @@
package sircd package irc
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package sircd package irc
import log "github.com/sirupsen/logrus" import log "github.com/sirupsen/logrus"
@ -6,15 +6,15 @@ type ircServerResponse struct {
code uint16 code uint16
symbol string symbol string
longtext string longtext string
params *[]string params *[]string
} }
func NewIrcServerResponse(code uint16, params *[]string) { func NewIrcServerResponse(code uint16, params *[]string) {
codes := ircResponseCodes() codes := ircResponseCodes()
r := new(ircServerResponse) r := new(ircServerResponse)
r.code = code r.code = code
r.symbol = (*codes)[code] r.symbol = (*codes)[code]
r.params = params r.params = params
} }
func ircResponseCodes() *map[uint16]string { func ircResponseCodes() *map[uint16]string {

View File

@ -1,4 +1,4 @@
package sircd package irc
import "github.com/sirupsen/logrus" import "github.com/sirupsen/logrus"
import "github.com/spf13/viper" import "github.com/spf13/viper"

View File

@ -1,4 +1,4 @@
package sircd package irc
import log "github.com/sirupsen/logrus" import log "github.com/sirupsen/logrus"