mirror of
https://github.com/Fishwaldo/restic-nats-server.git
synced 2025-03-15 19:41:35 +00:00
35 lines
685 B
Go
35 lines
685 B
Go
package internal
|
|
|
|
import (
|
|
"net/url"
|
|
"sync"
|
|
|
|
rns "github.com/Fishwaldo/restic-nats"
|
|
"github.com/nats-io/nats.go"
|
|
"gopkg.in/tomb.v2"
|
|
)
|
|
|
|
|
|
type WorkerConfigT struct {
|
|
NumWorkers int
|
|
Connections uint
|
|
}
|
|
|
|
type NatsConfigT struct {
|
|
MaxNatsConnections int
|
|
NatsURL *url.URL
|
|
NatsNKey string
|
|
NatsCredfile string
|
|
}
|
|
|
|
type GlobalStateT struct {
|
|
WorkerConfig WorkerConfigT
|
|
NatsConfig NatsConfigT
|
|
Conn *rns.ResticNatsClient
|
|
ClientCommand chan *nats.Msg
|
|
ClientCommandSubscription *nats.Subscription
|
|
Mx sync.Mutex
|
|
T tomb.Tomb
|
|
}
|
|
|
|
var GlobalState GlobalStateT
|