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)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
BUILDUSER := $(shell whoami)
BUILDHOST := $(shell hostname -s)
BUILDARCH := $(shell uname -m)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
GOFLAGS = -ldflags "$(GOLDFLAGS)"
FN := sircd
default: rundebug
rundebug: build
DEBUG=1 ./ircd
DEBUG=1 ./$(FN)
run: build
./ircd
./$(FN)
build: ./ircd
build: $(FN)
./ircd: *.go */*.go
go build -o $@ $(GOFLAGS) .
go-get:
cd cmd/$(FN) && go get -v
./$(FN): */*.go cmd/*/*.go go-get
cd cmd/$(FN) && go build -o ../../$(FN) $(GOFLAGS) .
fmt:
go fmt *.go
go fmt sircd/*.go
go fmt */*.go
go fmt cmd/$(FN)/*.go

View File

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

View File

@ -1,4 +1,4 @@
package sircd
package irc
import (
"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 {
sendstr = sendstr + " " + p
}

View File

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

View File

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

View File

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

View File

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

View File

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