Documentation
¶
Index ¶
- Variables
- func WithEmbargo(embargo int) *publishEmbargoOption
- func WithHeaders(headers map[string]string) *publishHeadersOption
- type MockPublishOpt
- type MockPublishOpt_Apply_Call
- type MockPublishOpt_Expecter
- type NamespaceKvs
- type NatsConnConfiguration
- type NatsService
- func (s *NatsService) KvsFor(ctx context.Context, ns string) (*NamespaceKvs, error)
- func (ns *NatsService) PublishMsg(ctx context.Context, subject string, sharMsg proto.Message) error
- func (ns *NatsService) PublishWorkflowState(ctx context.Context, stateName string, state *model.WorkflowState, ...) error
- type PublishOpt
- type PublishOptions
Constants ¶
This section is empty.
Variables ¶
var NatsConfig string
NatsConfig holds the current nats configuration for SHAR.
Functions ¶
func WithEmbargo ¶ added in v1.1.1687
func WithEmbargo(embargo int) *publishEmbargoOption
WithEmbargo allows the specification of an embargo time on a workflow state message
func WithHeaders ¶ added in v1.1.1687
WithHeaders allows the addition of extra headers to a workflow state message
Types ¶
type MockPublishOpt ¶ added in v1.1.1687
MockPublishOpt is an autogenerated mock type for the PublishOpt type
func NewMockPublishOpt ¶ added in v1.1.1687
func NewMockPublishOpt(t interface {
mock.TestingT
Cleanup(func())
}) *MockPublishOpt
NewMockPublishOpt creates a new instance of MockPublishOpt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockPublishOpt) Apply ¶ added in v1.1.1687
func (_m *MockPublishOpt) Apply(n *PublishOptions)
Apply provides a mock function with given fields: n
func (*MockPublishOpt) EXPECT ¶ added in v1.1.1687
func (_m *MockPublishOpt) EXPECT() *MockPublishOpt_Expecter
type MockPublishOpt_Apply_Call ¶ added in v1.1.1687
MockPublishOpt_Apply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apply'
func (*MockPublishOpt_Apply_Call) Return ¶ added in v1.1.1687
func (_c *MockPublishOpt_Apply_Call) Return() *MockPublishOpt_Apply_Call
func (*MockPublishOpt_Apply_Call) Run ¶ added in v1.1.1687
func (_c *MockPublishOpt_Apply_Call) Run(run func(n *PublishOptions)) *MockPublishOpt_Apply_Call
func (*MockPublishOpt_Apply_Call) RunAndReturn ¶ added in v1.1.1687
func (_c *MockPublishOpt_Apply_Call) RunAndReturn(run func(*PublishOptions)) *MockPublishOpt_Apply_Call
type MockPublishOpt_Expecter ¶ added in v1.1.1687
type MockPublishOpt_Expecter struct {
// contains filtered or unexported fields
}
func (*MockPublishOpt_Expecter) Apply ¶ added in v1.1.1687
func (_e *MockPublishOpt_Expecter) Apply(n interface{}) *MockPublishOpt_Apply_Call
Apply is a helper method to define mock.On call
- n *PublishOptions
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
WfTelemetry jetstream.KeyValue
Job jetstream.KeyValue
OwnerName jetstream.KeyValue
OwnerID jetstream.KeyValue
WfClientTask jetstream.KeyValue
WfGateway jetstream.KeyValue
//REM: WfHistory jetstream.KeyValue
WfLock jetstream.KeyValue
WfMsgTypes jetstream.KeyValue
WfProcess jetstream.KeyValue
WfMessages jetstream.KeyValue
WfClients jetstream.KeyValue
WfFatalError jetstream.KeyValue
WfUserTaskState jetstream.KeyValue
}
NamespaceKvs defines all the key value stores shar needs to operate
type NatsConnConfiguration ¶
type NatsConnConfiguration struct {
Conn *nats.Conn
TxConn *nats.Conn
StorageType jetstream.StorageType
JetStreamDomain string
}
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.
func (*NatsService) PublishMsg ¶ added in v1.1.1687
PublishMsg publishes a workflow message.
func (*NatsService) PublishWorkflowState ¶ added in v1.1.1687
func (ns *NatsService) PublishWorkflowState(ctx context.Context, stateName string, state *model.WorkflowState, opts ...PublishOpt) error
PublishWorkflowState publishes a SHAR state object to a given subject
type PublishOpt ¶ added in v1.1.1687
type PublishOpt interface {
Apply(n *PublishOptions)
}
PublishOpt represents an option that can be used when publishing a workflow state
type PublishOptions ¶ added in v1.1.1687
PublishOptions represents all options that are changeable when publishing workflow state