continued auth system

This commit is contained in:
zomo
2025-10-31 12:08:10 -05:00
parent 8355ca374b
commit 5f35823033
8 changed files with 186 additions and 30 deletions

View File

@@ -1,10 +1,29 @@
package db_cold
import (
"context"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"zomo.dev/largehadroncollider/util"
)
// sqlite file
func InitDBColdConn() (DBColdConn, error) {
return DBColdConn{}, nil
func InitDBColdConn(conf *util.Config) (*DBColdConn, error) {
db, err := gorm.Open(sqlite.Open(conf.SQliteDB), &gorm.Config{})
if err != nil {
return nil, err
}
ctx := context.Background()
cold := &DBColdConn{ db, ctx }
cold.initUserAuth()
return cold, nil
}
type DBColdConn struct {
Gorm *gorm.DB
Ctx context.Context
}