Add identity struct, WIP implement token event
This commit is contained in:
22
cmd/main.go
22
cmd/main.go
@@ -7,15 +7,31 @@ import (
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"git.defalsify.org/vise.git/db/mem"
|
||||
|
||||
"git.grassecon.net/urdt/ussd/config"
|
||||
"git.grassecon.net/urdt/ussd/initializers"
|
||||
"git.grassecon.net/term/event/nats"
|
||||
)
|
||||
|
||||
func init() {
|
||||
initializers.LoadEnvVariables()
|
||||
}
|
||||
|
||||
func main() {
|
||||
config.LoadConfig()
|
||||
|
||||
ctx := context.Background()
|
||||
n := nats.NewNatsSubscription()
|
||||
err := n.Connect(ctx, "localhost:4222")
|
||||
db := mem.NewMemDb()
|
||||
err := db.Connect(ctx, "")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Connect err: %v", err)
|
||||
fmt.Fprintf(os.Stderr, "Db connect err: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
n := nats.NewNatsSubscription(db)
|
||||
err = n.Connect(ctx, "localhost:4222")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Stream connect err: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer n.Close()
|
||||
|
||||
Reference in New Issue
Block a user