Commit WIP.

Laptop charger isn't charging?
This commit is contained in:
Benjamin A. Shelton 2026-10-07 18:57:26 -06:00
commit eeec866a31
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
5 changed files with 35 additions and 3 deletions

2
go.mod
View file

@ -14,6 +14,7 @@ require (
github.com/go-telegram/bot v1.25.0 // indirect
github.com/grbit/go-json v0.11.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jmoiron/sqlx v1.3.4 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/klauspost/compress v1.19.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
@ -32,6 +33,7 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.destrealm.net/cwrap v0.0.0-20201109183439-2847b5bcef78 // indirect
go.destrealm.net/errors v1.4.1 // indirect
go.destrealm.net/migratory v0.0.0-20261007163818-ce33bd6231af // indirect
go.destrealm.net/vfs v0.0.0-20261005172258-d049b9777092 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/sys v0.47.0 // indirect

7
go.sum
View file

@ -16,18 +16,23 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-telegram/bot v1.25.0 h1:C072msZtr+GjJiQsX/UJLirz+jzSNZVWkckxWufR7Ww=
github.com/go-telegram/bot v1.25.0/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM=
github.com/grbit/go-json v0.11.0 h1:bAbyMdYrYl/OjYsSqLH99N2DyQ291mHy726Mx+sYrnc=
github.com/grbit/go-json v0.11.0/go.mod h1:IYpHsdybQ386+6g3VE6AXQ3uTGa5mquBme5/ZWmtzek=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jmoiron/sqlx v1.3.4 h1:wv+0IJZfL5z0uZoUjlpKgHkgaFSYD+r9CfrXjEXsO7w=
github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.52 h1:wVbm2Qnf4OXkqhBTSPuCRZDRnxfbVrrmiCEroVdog8U=
github.com/mattn/go-sqlite3 v1.14.52/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
github.com/mymmrac/telego v1.12.1 h1:yx1T5pPSNsU3BjLR7jnfY0D4dtL9caH58Y9e8uzjR88=
@ -67,6 +72,8 @@ go.destrealm.net/cwrap v0.0.0-20201109183439-2847b5bcef78 h1:6PhjBZRPMK4g2svJSw5
go.destrealm.net/cwrap v0.0.0-20201109183439-2847b5bcef78/go.mod h1:XEMURlSRl36Iik3A1iigcziH/GIsfNZdWauoHMGf8YI=
go.destrealm.net/errors v1.4.1 h1:1qbZuBKK4AMAHV2fSoTJTzKJH5w7WQlHK1Q8AEsJ7/U=
go.destrealm.net/errors v1.4.1/go.mod h1:XTWkMcoJuLkH2i3eTHPlotnEE11ce8L0Bf8CtbPFzAI=
go.destrealm.net/migratory v0.0.0-20261007163818-ce33bd6231af h1:gSSUyNEMpJxo8N5QMg3neDvzlp6d/TMz0tVWiICFYQs=
go.destrealm.net/migratory v0.0.0-20261007163818-ce33bd6231af/go.mod h1:MeZ29G/OcVD2F8k+D9PfPaD57f0RlXFxsvGITnv9vEs=
go.destrealm.net/vfs v0.0.0-20261005172258-d049b9777092 h1:eKEE+/czReOg8R7VjLwx+V/IdeLb1x1lHzEoWH5SRwg=
go.destrealm.net/vfs v0.0.0-20261005172258-d049b9777092/go.mod h1:Ii64o7M71chtLhSllUZ+Yw5Oh7p9LZ3XaBghuXRmy6Y=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU=

17
internal/app/migration.go Normal file
View file

@ -0,0 +1,17 @@
package app
import (
"code.destrealm.net/zancarius/justusbot/internal/settings"
"go.destrealm.net/migratory"
)
func DoMigration(conf *settings.Settings) error {
mg, err := migratory.New(conf.System.DSN)
if err != nil {
return err
}
_ = mg
return nil
}

View file

@ -9,6 +9,11 @@ import (
func connect(conf *settings.Settings) error {
db, err := sql.Open("sqlite3", conf.System.DSN)
if err != nil {
return nil
}
_ = db
return nil
}

View file

@ -15,7 +15,7 @@ import (
type Settings struct {
file string `toml:"-"`
fs vfs.VFS `toml:"-"`
FS vfs.VFS `toml:"-"`
API *API `toml:"api"`
DailyScripture *DailyScripture `toml:"daily_scripture"`
Translations *Translations `toml:"translations"`
@ -26,7 +26,7 @@ type Settings struct {
// Reload previously loaded configuration.
func (s *Settings) Reload() error {
st, err := LoadSettings(s.file, s.fs)
st, err := LoadSettings(s.file, s.FS)
if err != nil {
return err
}
@ -46,7 +46,7 @@ func (s *Settings) Save() error {
if err != nil {
return err
}
fp, err := s.fs.Mutable().OpenFile(s.file, os.O_TRUNC|os.O_CREATE, 0644)
fp, err := s.FS.Mutable().OpenFile(s.file, os.O_TRUNC|os.O_CREATE, 0644)
if err != nil {
return err
}
@ -70,6 +70,7 @@ type DailyScripture struct {
type System struct {
TimeZone string `toml:"timezone"`
DSN string `toml:"dsn"`
}
type Service struct {