Refactor irc client (#19)

* refactor: update http handlers

* feat: add trace log level

* refactir: irc handler

* refactor(definitions): add irc settings and invite cmd:

* feat: add dft values to inputs

* refactor: indexer irc forms

* refactor(definitions): fix nickserv.password var:

* feat: pre fill indexer name field

* refactor: handle stopping and updates
This commit is contained in:
Ludvig Lundgren 2021-08-29 23:23:02 +02:00 committed by GitHub
parent 5f69ae9380
commit 4d40d41628
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 1380 additions and 943 deletions

View file

@ -1,35 +1,37 @@
package domain
import "context"
import (
"context"
"time"
)
type IrcChannel struct {
ID int64 `json:"id"`
Enabled bool `json:"enabled"`
Detached bool `json:"detached"`
Name string `json:"name"`
Password string `json:"password"`
ID int64 `json:"id"`
Enabled bool `json:"enabled"`
Name string `json:"name"`
Password string `json:"password"`
Detached bool `json:"detached"`
Monitoring bool `json:"monitoring"`
}
type SASL struct {
Mechanism string `json:"mechanism,omitempty"`
Plain struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
} `json:"plain,omitempty"`
type NickServ struct {
Account string `json:"account,omitempty"`
Password string `json:"password,omitempty"`
}
type IrcNetwork struct {
ID int64 `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Addr string `json:"addr"`
TLS bool `json:"tls"`
Nick string `json:"nick"`
Pass string `json:"pass"`
ConnectCommands []string `json:"connect_commands"`
SASL SASL `json:"sasl,omitempty"`
Channels []IrcChannel `json:"channels"`
ID int64 `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Server string `json:"server"`
Port int `json:"port"`
TLS bool `json:"tls"`
Pass string `json:"pass"`
InviteCommand string `json:"invite_command"`
NickServ NickServ `json:"nickserv,omitempty"`
Channels []IrcChannel `json:"channels"`
Connected bool `json:"connected"`
ConnectedSince *time.Time `json:"connected_since"`
}
type IrcRepo interface {