Browse Source

migrate irc dependency to github version.

master
Gisle Aune 4 years ago
parent
commit
d721112738
  1. 4
      .gitignore
  2. 26
      Gopkg.lock
  3. 38
      Gopkg.toml
  4. 8
      go.mod
  5. 12
      go.sum
  6. 4
      internal/bot/bot.go
  7. 2
      internal/bot/channel.go
  8. 5
      internal/bot/handler.go
  9. 1
      main.go

4
.gitignore

@ -3,4 +3,6 @@ debug
debug.exe debug.exe
logbot3 logbot3
logbot3.exe logbot3.exe
vendor/
# Idea
/.idea

26
Gopkg.lock

@ -1,26 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "git.aiterp.net/gisle/irc"
packages = [
".",
"ircutil",
"isupport",
"list"
]
revision = "36c2a5ea38d30ba32a02add83b54c2f579e9c037"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "7ef4c9d0736b7eb8e596036446cae5d12a8d7485db1559cfa8ade7ba1bf74263"
solver-name = "gps-cdcl"
solver-version = 1

38
Gopkg.toml

@ -1,38 +0,0 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
branch = "master"
name = "git.aiterp.net/gisle/irc"
[[constraint]]
name = "github.com/dgrijalva/jwt-go"
version = "3.2.0"
[prune]
go-tests = true
unused-packages = true

8
go.mod

@ -0,0 +1,8 @@
module git.aiterp.net/rpdata/logbot3
go 1.13
require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gissleh/irc v0.0.0-20200717144508-ec7511e0dfd4
)

12
go.sum

@ -0,0 +1,12 @@
git.aiterp.net/gisle/irc v0.0.0-20190317212656-36c2a5ea38d3 h1:2UYpXoDYcgeIGxRX+5K2e/CK0BNAQUZ6xU/9JjQYwDk=
git.aiterp.net/gisle/irc v0.0.0-20190317212656-36c2a5ea38d3/go.mod h1:7uklwlzI0XI2O8ttooTH0suUpUmQ8Pviplg36smc1Aw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/gissleh/irc v0.0.0-20200717144508-ec7511e0dfd4 h1:2rT4geKF5Zb0TyJjqp8ylUXwfrwIvMESdERItJtmtDI=
github.com/gissleh/irc v0.0.0-20200717144508-ec7511e0dfd4/go.mod h1:dUQ3oIxO/lK/Ga5Dq72/1tH861WBDJFkkBtbnqg6ZXc=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

4
internal/bot/bot.go

@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
"git.aiterp.net/gisle/irc"
"github.com/gissleh/irc"
"git.aiterp.net/rpdata/logbot3/internal/models" "git.aiterp.net/rpdata/logbot3/internal/models"
"git.aiterp.net/rpdata/logbot3/internal/models/channels" "git.aiterp.net/rpdata/logbot3/internal/models/channels"
) )
@ -34,6 +34,8 @@ func New(ctx context.Context, nick string, alternatives []string, user string, r
SkipSSLVerification: false, SkipSSLVerification: false,
}) })
client.AddHandler(handler)
bot := &Bot{ bot := &Bot{
client: client, client: client,
channels: make(map[string]*Channel), channels: make(map[string]*Channel),

2
internal/bot/channel.go

@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
"git.aiterp.net/gisle/irc"
"github.com/gissleh/irc"
"git.aiterp.net/rpdata/logbot3/internal/config" "git.aiterp.net/rpdata/logbot3/internal/config"
"git.aiterp.net/rpdata/logbot3/internal/models/channels" "git.aiterp.net/rpdata/logbot3/internal/models/channels"
"git.aiterp.net/rpdata/logbot3/internal/models/logs" "git.aiterp.net/rpdata/logbot3/internal/models/logs"

5
internal/bot/handler.go

@ -5,7 +5,7 @@ import (
"os" "os"
"strings" "strings"
"git.aiterp.net/gisle/irc"
"github.com/gissleh/irc"
"git.aiterp.net/rpdata/logbot3/internal/config" "git.aiterp.net/rpdata/logbot3/internal/config"
"git.aiterp.net/rpdata/logbot3/internal/util" "git.aiterp.net/rpdata/logbot3/internal/util"
) )
@ -139,6 +139,3 @@ func handler(event *irc.Event, client *irc.Client) {
} }
} }
func init() {
irc.Handle(handler)
}

1
main.go

@ -10,7 +10,6 @@ import (
"git.aiterp.net/rpdata/logbot3/internal/bot" "git.aiterp.net/rpdata/logbot3/internal/bot"
"git.aiterp.net/rpdata/logbot3/internal/config" "git.aiterp.net/rpdata/logbot3/internal/config"
"git.aiterp.net/rpdata/logbot3/internal/models/users" "git.aiterp.net/rpdata/logbot3/internal/models/users"
) )

Loading…
Cancel
Save