Documentation ¶
Index ¶
- Variables
- func AddPlayer(ctx context.Context, db *sql.DB, player Player, author int64) error
- func CreateHTTPServer(mux *http.ServeMux, listenAddr string) *http.Server
- func CreateRouter(database *sql.DB, config Config) *http.ServeMux
- func DiscordAddURL(clientID string) string
- func NewBot(token string) (*discordgo.Session, error)
- func OpenDB(dbPath string) (*sql.DB, error)
- func SetupDB(database *sql.DB) error
- func StartBot(ctx context.Context, session *discordgo.Session, database *sql.DB, ...) error
- func ValidateConfig(config Config) error
- type Config
- type LastSeen
- type ListSource
- type Player
- type PlayerListRoot
- type Proof
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMigration = errors.New("could not migrate db schema") ErrStoreIOFSOpen = errors.New("failed to create migration iofs") ErrStoreIOFSClose = errors.New("failed to close migration iofs") ErrStoreDriver = errors.New("failed to create db driver") ErrCreateMigration = errors.New("failed to create migrator") ErrPerformMigration = errors.New("failed to migrate database") ErrDuplicate = errors.New("duplicate entry") ErrNotFound = errors.New("entry not found") )
Functions ¶
func DiscordAddURL ¶
func ValidateConfig ¶
Types ¶
type Config ¶
type Config struct { SteamKey string `mapstructure:"steam_key"` DiscordClientID string `mapstructure:"discord_client_id"` DiscordBotToken string `mapstructure:"discord_bot_token"` DiscordRoles []string `mapstructure:"discord_roles"` ExternalURL string `mapstructure:"external_url"` DatabasePath string `mapstructure:"database_path"` ListenHost string `mapstructure:"listen_host"` ListenPort uint16 `mapstructure:"listen_port"` ListTitle string `mapstructure:"list_title"` ListDescription string `mapstructure:"list_description"` ListAuthors []string `mapstructure:"list_authors"` ExportedAttrs []string `mapstructure:"exported_attrs"` }
func ReadConfig ¶
func (Config) ListenAddr ¶ added in v1.0.5
type ListSource ¶
type PlayerListRoot ¶
type PlayerListRoot struct { ListSource ListSource `json:"file_info"` Schema string `json:"$schema"` Players []Player `json:"players"` Version int `json:"version"` }
Click to show internal directories.
Click to hide internal directories.