generated from alecodes/base-template
wip: implementing db initialization
This commit is contained in:
parent
ffd3c2014e
commit
140eef1fab
11 changed files with 451 additions and 0 deletions
42
pkg/types.go
Normal file
42
pkg/types.go
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package synchronizator
|
||||
|
||||
import (
|
||||
sql "database/sql"
|
||||
"os"
|
||||
)
|
||||
|
||||
type NodeType map[string]Node
|
||||
|
||||
type db struct {
|
||||
Connection *sql.DB
|
||||
logger *os.File
|
||||
log_level LogLevel
|
||||
drop_tables bool
|
||||
node_types NodeType
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
Logger *os.File
|
||||
Log_level LogLevel
|
||||
DANGEROUSLY_DROP_TABLES bool
|
||||
}
|
||||
|
||||
type Relationship struct {
|
||||
_class string
|
||||
_id_from int64
|
||||
_id_to int64
|
||||
from Node
|
||||
to Node
|
||||
metadata any
|
||||
}
|
||||
|
||||
type LogLevel int
|
||||
|
||||
// Lower levels take precedence
|
||||
|
||||
//go:generate stringer -type=LogLevel
|
||||
const (
|
||||
ERROR LogLevel = iota
|
||||
INFO
|
||||
DEBUG
|
||||
)
|
||||
Reference in a new issue