Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NatsConfig string
NatsConfig holds the current nats configuration for SHAR.
Functions ¶
This section is empty.
Types ¶
type NamespaceKvs ¶
type NamespaceKvs struct {
WfExecution jetstream.KeyValue
WfProcessInstance jetstream.KeyValue
WfUserTasks jetstream.KeyValue
WfTaskSpec jetstream.KeyValue
WfTaskSpecVer jetstream.KeyValue
Wf jetstream.KeyValue
WfVersion jetstream.KeyValue
WfTracking jetstream.KeyValue
Job jetstream.KeyValue
OwnerName jetstream.KeyValue
OwnerID jetstream.KeyValue
WfClientTask jetstream.KeyValue
WfGateway jetstream.KeyValue
WfName jetstream.KeyValue
WfHistory jetstream.KeyValue
WfLock jetstream.KeyValue
WfMsgTypes jetstream.KeyValue
WfProcess jetstream.KeyValue
WfMessages jetstream.KeyValue
WfClients jetstream.KeyValue
}
NamespaceKvs defines all of the key value stores shar needs to operate
type NatsConnConfiguration ¶
type NatsConnConfiguration struct {
Conn *nats.Conn
TxConn *nats.Conn
StorageType jetstream.StorageType
}
NatsConnConfiguration represents the configuration for a NATS connection.
- Conn: The NATS connection. - TxConn: The transactional NATS connection. - StorageType: The storage type for JetStream.
type NatsService ¶
type NatsService struct {
Js jetstream.JetStream
TxJS jetstream.JetStream
Conn common.NatsConn
StorageType jetstream.StorageType
Rwmx sync.RWMutex
// contains filtered or unexported fields
}
NatsService contains items enabling nats related communications e.g. publish, nats object manipulation via jetstream and namespaced KV access.
func NewNatsService ¶
func NewNatsService(nc *NatsConnConfiguration) (*NatsService, error)
NewNatsService constructs a new NatsService
func (*NatsService) KvsFor ¶
func (s *NatsService) KvsFor(ctx context.Context, ns string) (*NamespaceKvs, error)
KvsFor retrieves the shar KVs for a given namespace. If they do not exist for a namespace, it will initialise them and store them in a map for future lookup.