Documentation ¶
Index ¶
- func Delete(kv nats.KeyValue, key string) error
- func ElementTable(process *model.Workflow) map[string]*model.Element
- func EnsureBuckets(js nats.JetStreamContext, storageType nats.StorageType, names []string) error
- func IndexProcessElements(elements []*model.Element, el map[string]*model.Element)
- func KSuidTo128bit(k string) [16]byte
- func KSuidTo64bit(k string) [8]byte
- func Load(ctx context.Context, wf nats.KeyValue, k string) ([]byte, error)
- func LoadObj(ctx context.Context, wf nats.KeyValue, k string, v proto.Message) error
- func Log(ctx context.Context, js nats.JetStream, trackingID string, ...) error
- func Process(ctx context.Context, js nats.JetStreamContext, traceName string, ...) error
- func Save(ctx context.Context, wf nats.KeyValue, k string, v []byte) error
- func SaveObj(ctx context.Context, wf nats.KeyValue, k string, v proto.Message) error
- func UpdateObj[T proto.Message](ctx context.Context, wf nats.KeyValue, k string, msg T, ...) error
- type NatsConn
- type TrackingID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ElementTable ¶ added in v0.1.134
ElementTable indexes an entire process for quick ID lookups
func EnsureBuckets ¶
EnsureBuckets ensures that a list of key value stores exist
func IndexProcessElements ¶ added in v0.1.134
IndexProcessElements is the recursive part of the index
func KSuidTo128bit ¶ added in v0.1.78
KSuidTo128bit returns a KSuid as bytes.
func KSuidTo64bit ¶ added in v0.1.78
KSuidTo64bit takes the most variable 64 bits of a KSuid and returns them as bytes.
func Log ¶ added in v1.0.271
func Log(ctx context.Context, js nats.JetStream, trackingID string, source model.LogSource, severity messages.WorkflowLogLevel, code int32, message string, attrs map[string]string) error
Log is the generic metod to output to SHAR telemetry.
func Process ¶ added in v0.1.78
func Process(ctx context.Context, js nats.JetStreamContext, traceName string, closer chan struct{}, subject string, durable string, concurrency int, fn func(ctx context.Context, log *slog.Logger, msg *nats.Msg) (bool, error)) error
Process processes messages from a nats consumer and executes a function against each one.
Types ¶
type NatsConn ¶
type NatsConn interface { JetStream(opts ...nats.JSOpt) (nats.JetStreamContext, error) QueueSubscribe(subj string, queue string, cb nats.MsgHandler) (*nats.Subscription, error) }
NatsConn is the trimmad down NATS Connection interface that only emcompasses the methods used by SHAR
type TrackingID ¶ added in v1.0.215
type TrackingID []string
TrackingID is an ID stack that maintains the callstack
func (TrackingID) Ancestor ¶ added in v1.0.215
func (t TrackingID) Ancestor(gen int) string
Ancestor provides the ID of the caller back <gen> generations.
func (TrackingID) ParentID ¶ added in v1.0.215
func (t TrackingID) ParentID() string
ParentID provides the ID of the caller.
func (TrackingID) Pop ¶ added in v1.0.215
func (t TrackingID) Pop() TrackingID
Pop removes the current ID from the callstack.
func (TrackingID) Push ¶ added in v1.0.215
func (t TrackingID) Push(id string) TrackingID
Push adds a new ID to the callstack.