From 67fb901065a88dad48110fd3a7e862ece35d1a16 Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Wed, 10 Aug 2022 22:06:46 +0200 Subject: [PATCH] move config and Application struct to models --- cmd/bot/models.go | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/cmd/bot/models.go b/cmd/bot/models.go index 4459d52..3ea3f45 100644 --- a/cmd/bot/models.go +++ b/cmd/bot/models.go @@ -1,8 +1,34 @@ 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 ( ErrUserLevelNotInteger = errors.New("user level must be a number") 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 +}