2022-08-09 22:34:12 +02:00
|
|
|
package main
|
|
|
|
|
2022-08-10 22:06:46 +02:00
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/gempir/go-twitch-irc/v3"
|
|
|
|
"github.com/lyx0/nourybot/internal/data"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
2022-08-09 22:34:12 +02:00
|
|
|
|
|
|
|
var (
|
|
|
|
ErrUserLevelNotInteger = errors.New("user level must be a number")
|
2022-08-10 00:14:54 +02:00
|
|
|
ErrRecordNotFound = errors.New("user not found in the database")
|
2022-08-09 22:34:12 +02:00
|
|
|
)
|
2022-08-10 22:06:46 +02:00
|
|
|
|
|
|
|
type config struct {
|
|
|
|
twitchUsername string
|
|
|
|
twitchOauth string
|
|
|
|
environment string
|
|
|
|
db struct {
|
|
|
|
dsn string
|
|
|
|
maxOpenConns int
|
|
|
|
maxIdleConns int
|
|
|
|
maxIdleTime string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type Application struct {
|
|
|
|
TwitchClient *twitch.Client
|
|
|
|
Logger *zap.SugaredLogger
|
|
|
|
Db *sql.DB
|
|
|
|
Models data.Models
|
|
|
|
}
|