mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
459 B
Go
27 lines
459 B
Go
//
|
|
// nats.go
|
|
// Copyright (C) 2024 veypi <i@veypi.com>
|
|
// 2024-10-11 17:32
|
|
// Distributed under terms of the MIT license.
|
|
//
|
|
|
|
package cfg
|
|
|
|
import (
|
|
"github.com/nats-io/nats-server/v2/server"
|
|
"github.com/veypi/utils/logv"
|
|
)
|
|
|
|
func RunNats() {
|
|
opts := &server.Options{
|
|
ConfigFile: "~/.config/oa/nats.cfg2",
|
|
}
|
|
ns, err := server.NewServer(opts)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
// Start the nats server
|
|
logv.Info().Msg("nats server start")
|
|
ns.Start()
|
|
}
|