forked from Minecraft/canopeas
Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
|
2baf3491b3 |
|
@ -7,10 +7,12 @@ import (
|
||||||
var (
|
var (
|
||||||
firedBucket = []byte("fired")
|
firedBucket = []byte("fired")
|
||||||
unbanBucket = []byte("unban")
|
unbanBucket = []byte("unban")
|
||||||
|
trackBucket = []byte("track")
|
||||||
|
|
||||||
buckets = [][]byte{
|
buckets = [][]byte{
|
||||||
firedBucket,
|
firedBucket,
|
||||||
unbanBucket,
|
unbanBucket,
|
||||||
|
trackBucket,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package database
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"git.jojodev.com/Minecraft/canopeas/discord/track"
|
||||||
|
"go.etcd.io/bbolt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// LoadTracker loads the tracks from the database
|
||||||
|
func (db *Database) LoadTracker() (track.Tracker, error) {
|
||||||
|
t := track.New()
|
||||||
|
return t, db.db.View(func(tx *bbolt.Tx) error {
|
||||||
|
return tx.Bucket(trackBucket).ForEach(func(k, v []byte) error {
|
||||||
|
var users map[string]struct{}
|
||||||
|
if err := json.Unmarshal(v, &users); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
t[string(k)] = users
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTrack sets a list of trackers for a word
|
||||||
|
func (db *Database) SetTrack(word string, trackers map[string]struct{}) error {
|
||||||
|
return db.db.Update(func(tx *bbolt.Tx) error {
|
||||||
|
v, err := json.Marshal(trackers)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return tx.Bucket(trackBucket).Put([]byte(word), v)
|
||||||
|
})
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package discord
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.jojodev.com/Minecraft/canopeas/discord/track"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -67,6 +68,12 @@ func Bot(cfg *config.Config, db *database.Database) (*discordgo.Session, error)
|
||||||
twitterHttpClient := twitterConfig.Client(oauth1.NoContext, twitterToken)
|
twitterHttpClient := twitterConfig.Client(oauth1.NoContext, twitterToken)
|
||||||
twitterClient := twitter.NewClient(twitterHttpClient)
|
twitterClient := twitter.NewClient(twitterHttpClient)
|
||||||
|
|
||||||
|
// Init tracker
|
||||||
|
t, err := db.LoadTracker()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Init Unban Schedule
|
// Init Unban Schedule
|
||||||
sched := &unbanSchedule{
|
sched := &unbanSchedule{
|
||||||
db: db,
|
db: db,
|
||||||
|
@ -104,7 +111,9 @@ func Bot(cfg *config.Config, db *database.Database) (*discordgo.Session, error)
|
||||||
bot.AddHandler(joinHandler(cfg))
|
bot.AddHandler(joinHandler(cfg))
|
||||||
bot.AddHandler(leaveHandler(cfg))
|
bot.AddHandler(leaveHandler(cfg))
|
||||||
bot.AddHandler(commandHandler(cfg, db, sapi, twitterClient))
|
bot.AddHandler(commandHandler(cfg, db, sapi, twitterClient))
|
||||||
bot.AddHandler(messageHandler(cfg, db))
|
bot.AddHandler(pingHandler(cfg, db))
|
||||||
|
bot.AddHandler(trackHandler(t))
|
||||||
|
bot.AddHandler(trackCommandHandler(t, db))
|
||||||
bot.AddHandler(reactionAddHandler())
|
bot.AddHandler(reactionAddHandler())
|
||||||
bot.AddHandler(reactionRemoveHandler())
|
bot.AddHandler(reactionRemoveHandler())
|
||||||
|
|
||||||
|
@ -118,6 +127,13 @@ func Bot(cfg *config.Config, db *database.Database) (*discordgo.Session, error)
|
||||||
// Intents
|
// Intents
|
||||||
bot.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAll)
|
bot.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAll)
|
||||||
|
|
||||||
|
// Create application commands
|
||||||
|
if _, err := bot.ApplicationCommandBulkOverwrite(bot.State.User.ID, "", []*discordgo.ApplicationCommand{
|
||||||
|
trackCommand,
|
||||||
|
}); err != nil {
|
||||||
|
log.Err(err).Msg("could not create application commands")
|
||||||
|
}
|
||||||
|
|
||||||
return bot, nil
|
return bot, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +248,7 @@ func commandHandler(cfg *config.Config, db *database.Database, sapi *serverapi.C
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func messageHandler(cfg *config.Config, db *database.Database) func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
func pingHandler(cfg *config.Config, db *database.Database) func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
return func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
return func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
// Ignore bots
|
// Ignore bots
|
||||||
if m.Author.Bot {
|
if m.Author.Bot {
|
||||||
|
@ -250,6 +266,25 @@ func messageHandler(cfg *config.Config, db *database.Database) func(s *discordgo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func trackHandler(t track.Tracker) func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
|
return func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
|
// Ignore bots
|
||||||
|
if m.Author.Bot {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
trackers := t.Search(strings.ToLower(m.Content))
|
||||||
|
for _, tracker := range trackers {
|
||||||
|
// Ignore self-trackers
|
||||||
|
if tracker == m.Author.ID {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
sendMessage(s, tracker, fmt.Sprintf("%s\n>>>%s", m.Author.Mention(), m.Content), true)
|
||||||
|
sendMessage(s, tracker, fmt.Sprintf("https://discord.com/channels/%s/%s/%s", m.GuildID, m.ChannelID, m.ID), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func reactionAddHandler() func(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
func reactionAddHandler() func(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
||||||
return func(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
return func(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
||||||
reactionHandler(true, s, m.MessageReaction)
|
reactionHandler(true, s, m.MessageReaction)
|
||||||
|
@ -265,7 +300,7 @@ func reactionRemoveHandler() func(s *discordgo.Session, m *discordgo.MessageReac
|
||||||
func reactionHandler(add bool, s *discordgo.Session, m *discordgo.MessageReaction) {
|
func reactionHandler(add bool, s *discordgo.Session, m *discordgo.MessageReaction) {
|
||||||
if _, ok := messageRoleMap[m.MessageID]; ok {
|
if _, ok := messageRoleMap[m.MessageID]; ok {
|
||||||
if r, ok := messageRoleMap[m.MessageID][m.Emoji.APIName()]; ok {
|
if r, ok := messageRoleMap[m.MessageID][m.Emoji.APIName()]; ok {
|
||||||
var roleCmd func(guildID, userID, roleID string, opts ...discordgo.RequestOption) (err error)
|
var roleCmd func(guildID, userID, roleID string) (err error)
|
||||||
if add {
|
if add {
|
||||||
roleCmd = s.GuildMemberRoleAdd
|
roleCmd = s.GuildMemberRoleAdd
|
||||||
} else {
|
} else {
|
||||||
|
@ -290,7 +325,7 @@ func updateStatus(s *discordgo.Session) {
|
||||||
dj, err := newDadJoke()
|
dj, err := newDadJoke()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Msgf("could not get new dad joke: %v", err)
|
log.Warn().Msgf("could not get new dad joke: %v", err)
|
||||||
} else if err := s.UpdateGameStatus(0, dj.Joke); err != nil {
|
} else if err := s.UpdateGameStatus(1, dj.Joke); err != nil {
|
||||||
log.Warn().Msgf("could not update status: %v", err)
|
log.Warn().Msgf("could not update status: %v", err)
|
||||||
}
|
}
|
||||||
<-ticker.C
|
<-ticker.C
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package discord
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"git.jojodev.com/Minecraft/canopeas/database"
|
||||||
|
"git.jojodev.com/Minecraft/canopeas/discord/track"
|
||||||
|
"github.com/bwmarrin/discordgo"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
var trackCommand = &discordgo.ApplicationCommand{
|
||||||
|
Name: "track",
|
||||||
|
Description: "Track words",
|
||||||
|
Options: []*discordgo.ApplicationCommandOption{
|
||||||
|
{
|
||||||
|
Type: discordgo.ApplicationCommandOptionSubCommand,
|
||||||
|
Name: "add",
|
||||||
|
Description: "Add a tracked word",
|
||||||
|
Options: []*discordgo.ApplicationCommandOption{
|
||||||
|
{
|
||||||
|
Type: discordgo.ApplicationCommandOptionString,
|
||||||
|
Name: "word",
|
||||||
|
Description: "The word to track",
|
||||||
|
Required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Type: discordgo.ApplicationCommandOptionSubCommand,
|
||||||
|
Name: "remove",
|
||||||
|
Description: "Remove a tracked word",
|
||||||
|
Options: []*discordgo.ApplicationCommandOption{
|
||||||
|
{
|
||||||
|
Type: discordgo.ApplicationCommandOptionString,
|
||||||
|
Name: "word",
|
||||||
|
Description: "The tracked word to remove",
|
||||||
|
Required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
trackCommandHandler = func(t track.Tracker, d *database.Database) func(*discordgo.Session, *discordgo.InteractionCreate) {
|
||||||
|
return func(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
|
var action string
|
||||||
|
word := strings.ToLower(i.ApplicationCommandData().Options[0].Options[0].StringValue())
|
||||||
|
switch i.ApplicationCommandData().Options[0].Name {
|
||||||
|
case "add":
|
||||||
|
action = "added"
|
||||||
|
t.Add(word, i.User.ID)
|
||||||
|
case "remove":
|
||||||
|
action = "removed"
|
||||||
|
t.Remove(word, i.User.ID)
|
||||||
|
default:
|
||||||
|
log.Error().Msg("Track command did a woopsie")
|
||||||
|
}
|
||||||
|
if err := d.SetTrack(word, t[word]); err != nil {
|
||||||
|
log.Err(err).Msg("")
|
||||||
|
}
|
||||||
|
if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||||
|
Data: &discordgo.InteractionResponseData{
|
||||||
|
Content: fmt.Sprintf("Successfully %s tracking for %q", action, word),
|
||||||
|
Flags: uint64(discordgo.MessageFlagsEphemeral),
|
||||||
|
},
|
||||||
|
}); err != nil {
|
||||||
|
log.Err(err).Msg("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
|
@ -0,0 +1,52 @@
|
||||||
|
package track
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
// Tracker is a mapping of tracked words to a set of user IDs
|
||||||
|
type Tracker map[string]map[string]struct{}
|
||||||
|
|
||||||
|
// New returns an initialized Tracker
|
||||||
|
func New() Tracker {
|
||||||
|
return make(Tracker)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a user ID tracking a word
|
||||||
|
func (t Tracker) Add(word, userID string) {
|
||||||
|
if _, ok := t[word]; !ok {
|
||||||
|
t[word] = make(map[string]struct{})
|
||||||
|
}
|
||||||
|
t[word][userID] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove a user ID tracking a word
|
||||||
|
func (t Tracker) Remove(word, userID string) bool {
|
||||||
|
if _, ok := t[word][userID]; ok {
|
||||||
|
delete(t[word], userID)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search for a tracked word and return the list of unique user IDs
|
||||||
|
func (t Tracker) Search(msg string) []string {
|
||||||
|
tokens := make(map[string]struct{})
|
||||||
|
fields := strings.Fields(msg)
|
||||||
|
for _, field := range fields {
|
||||||
|
field = strings.Trim(field, `.,;:'"!?`)
|
||||||
|
tokens[field] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
set := make(map[string]struct{}, 0)
|
||||||
|
for word, users := range t {
|
||||||
|
if _, ok := tokens[word]; ok {
|
||||||
|
for user := range users {
|
||||||
|
set[user] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
users := make([]string, 0, len(set))
|
||||||
|
for user := range set {
|
||||||
|
users = append(users, user)
|
||||||
|
}
|
||||||
|
return users
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package track
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/matryer/is"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestTracker(t *testing.T) {
|
||||||
|
assert := is.New(t)
|
||||||
|
|
||||||
|
track := New()
|
||||||
|
|
||||||
|
track.Add("admin", "foo")
|
||||||
|
track.Add("mod", "foo")
|
||||||
|
track.Add("mod", "bar")
|
||||||
|
track.Add("mode", "bar")
|
||||||
|
|
||||||
|
admin := track.Search("I need an admin.")
|
||||||
|
assert.Equal(len(admin), 1) // One tracker for admin
|
||||||
|
|
||||||
|
mod := track.Search("I need a mod. Please send me a mod.")
|
||||||
|
assert.Equal(len(mod), 2) // Two trackers for mod
|
||||||
|
|
||||||
|
mode := track.Search("I'm in gaminga mode!")
|
||||||
|
assert.Equal(len(mode), 1) // One tracker for mode
|
||||||
|
|
||||||
|
}
|
6
go.mod
6
go.mod
|
@ -7,12 +7,14 @@ require (
|
||||||
git.jojodev.com/Minecraft/go-serverapi v0.0.1
|
git.jojodev.com/Minecraft/go-serverapi v0.0.1
|
||||||
gitea.com/jolheiser/gojang v0.0.7
|
gitea.com/jolheiser/gojang v0.0.7
|
||||||
gitea.com/jolheiser/xkcd v0.0.2
|
gitea.com/jolheiser/xkcd v0.0.2
|
||||||
github.com/bwmarrin/discordgo v0.27.1
|
github.com/bwmarrin/discordgo v0.23.3-0.20220223175904-4cc53b7ed45c
|
||||||
github.com/dghubble/go-twitter v0.0.0-20201011215211-4b180d0cc78d
|
github.com/dghubble/go-twitter v0.0.0-20201011215211-4b180d0cc78d
|
||||||
github.com/dghubble/oauth1 v0.7.0
|
github.com/dghubble/oauth1 v0.7.0
|
||||||
github.com/gorilla/websocket v1.5.0 // indirect
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
|
github.com/matryer/is v1.4.0 // indirect
|
||||||
github.com/pelletier/go-toml v1.8.1
|
github.com/pelletier/go-toml v1.8.1
|
||||||
github.com/rs/zerolog v1.26.1
|
github.com/rs/zerolog v1.26.1
|
||||||
go.etcd.io/bbolt v1.3.4
|
go.etcd.io/bbolt v1.3.4
|
||||||
golang.org/x/crypto v0.8.0 // indirect
|
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20220224003255-dbe011f71a99 // indirect
|
||||||
)
|
)
|
||||||
|
|
42
go.sum
42
go.sum
|
@ -6,8 +6,10 @@ gitea.com/jolheiser/gojang v0.0.7 h1:Q4cG7QYiKQsJtUWgXXiolAH9DCLRoaQ4olaO9OV628U
|
||||||
gitea.com/jolheiser/gojang v0.0.7/go.mod h1:r9kj2wv/21Da7VpWz+qmxLexH85o2BAM4NMxeYgQlcY=
|
gitea.com/jolheiser/gojang v0.0.7/go.mod h1:r9kj2wv/21Da7VpWz+qmxLexH85o2BAM4NMxeYgQlcY=
|
||||||
gitea.com/jolheiser/xkcd v0.0.2 h1:HJP83YwSKxSYcoNfpb1ZpAfBvkUAnN+YgeukraXtfrc=
|
gitea.com/jolheiser/xkcd v0.0.2 h1:HJP83YwSKxSYcoNfpb1ZpAfBvkUAnN+YgeukraXtfrc=
|
||||||
gitea.com/jolheiser/xkcd v0.0.2/go.mod h1:aDa2vX54wLaX8Ra5CGN2GWBX13UWAGJKGGddzHl/hks=
|
gitea.com/jolheiser/xkcd v0.0.2/go.mod h1:aDa2vX54wLaX8Ra5CGN2GWBX13UWAGJKGGddzHl/hks=
|
||||||
github.com/bwmarrin/discordgo v0.27.1 h1:ib9AIc/dom1E/fSIulrBwnez0CToJE113ZGt4HoliGY=
|
github.com/bwmarrin/discordgo v0.22.0 h1:uBxY1HmlVCsW1IuaPjpCGT6A2DBwRn0nvOguQIxDdFM=
|
||||||
github.com/bwmarrin/discordgo v0.27.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
|
github.com/bwmarrin/discordgo v0.22.0/go.mod h1:c1WtWUGN6nREDmzIpyTp/iD3VYt4Fpx+bVyfBG7JE+M=
|
||||||
|
github.com/bwmarrin/discordgo v0.23.3-0.20220223175904-4cc53b7ed45c h1:efrWWIJhwYDtEhZsduYcJVtMD0m5qb/1X/5TExrsWXg=
|
||||||
|
github.com/bwmarrin/discordgo v0.23.3-0.20220223175904-4cc53b7ed45c/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
|
||||||
github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY=
|
github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY=
|
||||||
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
|
@ -23,9 +25,13 @@ github.com/dghubble/sling v1.3.0/go.mod h1:XXShWaBWKzNLhu2OxikSNFrlsvowtz4kyRuXU
|
||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
||||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||||
|
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||||
|
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
|
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
|
||||||
|
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
|
||||||
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
|
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
|
||||||
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
|
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
@ -38,59 +44,43 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
|
||||||
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
|
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
|
||||||
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||||
go.jolheiser.com/gql v0.0.1 h1:y3LGHcJUZI9otTCcMn8TVdF3aEzNX0FW6m0YUamlLto=
|
go.jolheiser.com/gql v0.0.1 h1:y3LGHcJUZI9otTCcMn8TVdF3aEzNX0FW6m0YUamlLto=
|
||||||
go.jolheiser.com/gql v0.0.1/go.mod h1:74eYqVRIxsOFxtVl0RYGKNyYQgJYQaxOCgar7LP71Hw=
|
go.jolheiser.com/gql v0.0.1/go.mod h1:74eYqVRIxsOFxtVl0RYGKNyYQgJYQaxOCgar7LP71Hw=
|
||||||
|
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e h1:1SzTfNOXwIS2oWiMF+6qu0OUDKb0dauo6MoDUQyu+yU=
|
||||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||||
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
|
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE=
|
||||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
|
||||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
|
||||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA=
|
||||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220224003255-dbe011f71a99 h1:Us899Z5PCfOrSgeCYWobI1/bSigAz9Rhf8+fz5Grkzc=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220224003255-dbe011f71a99/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
|
|
||||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
|
||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
|
||||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|
||||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
|
||||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
|
||||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
|
Loading…
Reference in New Issue