mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
move config and Application struct to models
This commit is contained in:
parent
a0e724d009
commit
67fb901065
|
@ -1,8 +1,34 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "errors"
|
import (
|
||||||
|
"database/sql"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"github.com/gempir/go-twitch-irc/v3"
|
||||||
|
"github.com/lyx0/nourybot/internal/data"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrUserLevelNotInteger = errors.New("user level must be a number")
|
ErrUserLevelNotInteger = errors.New("user level must be a number")
|
||||||
ErrRecordNotFound = errors.New("user not found in the database")
|
ErrRecordNotFound = errors.New("user not found in the database")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue