client

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 32 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package client is a typed wrapper over grpcproc's Inspector, shared by grpcprocctl and its MCP server: flat, readable views of nodes, processes and events, target parsing, and a walk over every node of a cluster.

Index

Constants

View Source
const (
	// WalkTime is how long grpcprocctl's commands, MCP tools and web UI
	// give Cluster, unless their limit for each request is longer.
	WalkTime = 30 * time.Second
	// LinksUpTo is the ClusterOptions.LinksUpTo they pass.
	LinksUpTo = 32
)
View Source
const (
	NotAnswered  = "not answered in time"
	NotInspected = "serves no Inspector"
)

What to show where an error goes: for an Unanswered node, and for one with NoInspector.

Variables

View Source
var (
	// ErrNoNames is the error of a node without global names (Config.Names).
	ErrNoNames = errors.New("the node has no global names (Config.Names)")
	// ErrUnlisted is the error of a node whose global names cannot be listed,
	// only looked up one at a time.
	ErrUnlisted = errors.New("the node's global names cannot be listed, only looked up by name")
)
View Source
var ErrNoGroups = errors.New("no grpcproc/groups scope")

ErrNoGroups is the error of a node that runs no grpcproc/groups scope, or none of the name asked.

Functions

func Leading added in v0.1.0

func Leading(views []ElectorView) string

Leading is the node views say leads: of the nodes that say they lead, and those that serve no Inspector, which cannot, that a node follows, the one of the highest term; empty while there is none. A node that follows another that can say so and does not names no leader.

func ParseKinds added in v0.0.4

func ParseKinds(names []string) ([]string, error)

ParseKinds checks names of event kinds (spawn, exit, link-up, link-down, dead-letter), trimming spaces, and returns them.

func ParseLevel

func ParseLevel(s string) (slog.Level, error)

ParseLevel reads a log level: debug, info, warn, error (each with an optional offset, as in debug-4), or a number. It must fit the Inspector's int32.

func Reached added in v0.12.0

func Reached(nodes []NodeView) []string

Reached names the nodes that were described: they answered, and serve an Inspector.

func SortProcesses

func SortProcesses(ps []ProcessView, by string) error

SortProcesses orders ps by pid (as listed), or by mailbox, received, sent or busy (BusySeconds), largest first.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client talks to one Inspector; requests about other nodes are forwarded by it.

func New

New wraps a connection to a node serving grpcproc.inspect.v1.Inspector.

func (*Client) Cluster

func (c *Client) Cluster(ctx context.Context, o ClusterOptions) ([]NodeView, error)

Cluster describes the node serving the Inspector, first, and the others it knows of, ordered by name: those its Config.Membership reports up, and those it is linked to. When it reports none, as without a Membership, it walks the links of every node it finds. Only the first node lists its members. A node that cannot be asked is listed with Error, one that serves no Inspector with NoInspector, and a member of either with the address and metadata its Membership reports; one that ctx ended before it was asked or answered is listed as Unanswered.

func (*Client) Cordon added in v0.1.0

func (c *Client) Cordon(ctx context.Context, cluster, node string, off bool) (string, error)

Cordon keeps node from leading cluster, or, with off, lets it lead again. It returns the node that led, once a majority holds the change; if node was that leader, it is handing over.

func (*Client) Cron added in v0.1.0

func (c *Client) Cron(ctx context.Context, node, target string) (CronView, error)

Cron describes one cron process, found as Process finds one.

func (*Client) CronJob added in v0.1.0

func (c *Client) CronJob(ctx context.Context, node, target, op, job string) error

CronJob changes the job called job of a cron process, found as Process finds one: enable, disable or remove it. The process answers once it has.

func (*Client) Crons added in v0.1.0

func (c *Client) Crons(ctx context.Context, node string) ([]CronView, error)

Crons describes the cron processes of node, by PID, or when node is empty CronsOf the nodes Cluster finds.

func (*Client) CronsOf added in v0.12.0

func (c *Client) CronsOf(ctx context.Context, nodes []NodeView, timeout time.Duration) []CronView

CronsOf describes the cron processes of nodes, found by their label, cron, in nodes' order and by PID on each, asking the nodes at once, each within timeout (0: ctx alone). A node that cannot be asked is listed with its Error; one that serves no Inspector is left out.

func (*Client) Election added in v0.1.0

func (c *Client) Election(ctx context.Context, cluster string) ([]ElectorView, error)

Election describes the election called cluster on every node Cluster finds that takes part in it, in Cluster's order, asking them at once. A node that runs no elector for it is left out; one that cannot be asked, or serves no Inspector and is named by the others (takesPart), is listed with its Error.

func (*Client) Elections added in v0.4.0

func (c *Client) Elections(ctx context.Context) ([]ElectionView, error)

Elections is ElectionsOf the nodes Cluster finds.

func (*Client) ElectionsOf added in v0.12.0

func (c *Client) ElectionsOf(ctx context.Context, nodes []NodeView, timeout time.Duration) ([]ElectionView, error)

ElectionsOf finds every grpcproc/leader election that one of nodes takes part in, by the names its electors are registered under, and describes each, in order of name, as the nodes that run it see it, in nodes' order. It asks each node at once, each within timeout (0: ctx alone). A node that cannot be asked is listed in each election with its Error, one that serves no Inspector only in those whose electors name it (takesPart); an election whose electors all exit while it is asked, with none. When no election is found and a node that may run one could not be asked, that is the error.

func (*Client) Exit

func (c *Client) Exit(ctx context.Context, node, target, reason string) error

Exit asks a process to exit with reason ("killed" when empty).

func (*Client) GroupMembers added in v0.13.0

func (c *Client) GroupMembers(ctx context.Context, node, scope, group string, limit int) (GroupMembersView, error)

GroupMembers lists the members of group in scope, at most limit of them (1000 when 0), as node's copy has them.

func (*Client) Groups added in v0.13.0

func (c *Client) Groups(ctx context.Context, node, scope, prefix string, limit int) (GroupsView, error)

Groups lists the groups of scope ("" for the default scope, or the node's first) whose names start with prefix, at most limit of them (1000 when 0), as node's copy has them; "" is the node serving the Inspector.

func (*Client) LookupName added in v0.5.0

func (c *Client) LookupName(ctx context.Context, node, name string) (NameView, bool, error)

LookupName says who holds a global name, as node's copy of the names has it; "" is the node serving the Inspector.

func (*Client) MoveLeader added in v0.1.0

func (c *Client) MoveLeader(ctx context.Context, cluster, to string) (string, error)

MoveLeader asks the leader of cluster to hand over: to the node to, or, with to empty, to the follower with the latest state. It returns the node that led, once that node has told its successor to campaign.

func (*Client) Names added in v0.5.0

func (c *Client) Names(ctx context.Context, node, prefix string, limit int) ([]NameView, error)

Names lists global names with prefix, ordered by name, at most limit of them (the node's default, 1000, when 0).

func (*Client) Node

func (c *Client) Node(ctx context.Context, node string) (NodeView, error)

Node describes one node; "" is the node serving the Inspector.

func (*Client) Process

func (c *Client) Process(ctx context.Context, node, target string, ask bool, wait time.Duration) (ProcessView, error)

Process describes one process; with ask, also what it publishes about itself, waiting up to wait for a busy process to answer.

func (*Client) Processes

func (c *Client) Processes(ctx context.Context, node string, f Filter) ([]ProcessView, error)

Processes lists the processes of node that match f, ordered by PID.

func (*Client) ResumeSaga added in v0.10.0

func (c *Client) ResumeSaga(ctx context.Context, node, saga, id string) (SagaRunView, error)

ResumeSaga makes a stuck run active again, due at once, its attempts counted from none, and returns it as the same engine then has it.

func (*Client) SagaEngines added in v0.10.0

func (c *Client) SagaEngines(ctx context.Context, node string) ([]SagaEngineView, error)

SagaEngines describes the saga engines of node, by PID, or when node is empty SagaEnginesOf the nodes Cluster finds.

func (*Client) SagaEnginesOf added in v0.12.0

func (c *Client) SagaEnginesOf(ctx context.Context, nodes []NodeView, timeout time.Duration) []SagaEngineView

SagaEnginesOf describes the saga engines of nodes, in nodes' order and by PID on each, asking the nodes at once, each within timeout (0: ctx alone). A node that cannot be asked is listed with its Error; one that serves no Inspector is left out.

func (*Client) SagaRun added in v0.10.0

func (c *Client) SagaRun(ctx context.Context, node, saga, id string) (SagaRunView, error)

SagaRun describes one run, with its data and its signals' payloads as JSON when the engine shows them (saga.Config.InspectData).

func (*Client) SagaRuns added in v0.10.0

func (c *Client) SagaRuns(ctx context.Context, node string, q SagaQuery) (runs []SagaRunView, more bool, err error)

SagaRuns lists the runs q asks for, from an engine found as engine finds one, by saga and then ID; more says whether there are more after the last. With no saga named, they are the runs of the sagas one engine runs.

func (*Client) SetLogLevel

func (c *Client) SetLogLevel(ctx context.Context, node, target string, level slog.Level) error

SetLogLevel sets a process's log threshold.

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, node string, fn func(EventView) bool) error

Watch streams node's events to fn until ctx is done or fn returns false. It returns nil when either ends it, and when the Inspector ends the stream cleanly (EOF), which it does once it sees ctx done.

type ClusterOptions added in v0.12.0

type ClusterOptions struct {
	// LinksUpTo lists each node's links (NodeView.Links) when Cluster finds
	// at most this many nodes; past it, a node's links are only added up, as
	// a node of a large cluster has many.
	LinksUpTo int
	// GroupLinksBy adds each node's links up by this key of its peers'
	// metadata (NodeView.LinkTotals); empty adds them all up together.
	GroupLinksBy string
	// NodeTimeout bounds the request to each node, so that one that hangs
	// only fails itself; 0 leaves only ctx, and one that hangs holds one of
	// the Parallel requests until ctx ends.
	NodeTimeout time.Duration
	// Parallel is how many nodes are asked at once: 32 when 0.
	Parallel int
}

ClusterOptions says what Cluster asks each node for.

type CronJobView added in v0.1.0

type CronJobView struct {
	Name     string `json:"name"`
	Spec     string `json:"spec" jsonschema:"when it runs, in crontab syntax"`
	Location string `json:"location" jsonschema:"the time zone its spec is read in"`
	Next     string `json:"next,omitempty" jsonschema:"when it runs next, in its zone"`
	Last     string `json:"last,omitempty" jsonschema:"the minute its last run was due, in its zone"`
	Running  int    `json:"running,omitzero" jsonschema:"its runs going now"`
	Disabled bool   `json:"disabled,omitzero" jsonschema:"kept, but not run, until enabled"`
	Failure  string `json:"failure,omitempty" jsonschema:"why its last failed run failed: the error it returned, a panic, timeout or replaced"`
}

CronJobView is one job of a cron process, as the process publishes it.

type CronView added in v0.1.0

type CronView struct {
	Node string `json:"node"`
	// Process is the cron process's registered name, or its pid.
	Process string        `json:"process"`
	PID     string        `json:"pid"`
	Jobs    []CronJobView `json:"jobs"`
	Error   string        `json:"error,omitempty" jsonschema:"why its jobs could not be read: it is busy, or gone, or its node could not be asked"`
}

CronView is a grpcproc/cron process and its jobs.

type ElectionView added in v0.4.0

type ElectionView struct {
	Cluster  string        `json:"cluster"`
	Leading  string        `` /* 189-byte string literal not displayed */
	Electors []ElectorView `json:"electors"`
}

ElectionView is one grpcproc/leader election, as each node that takes part sees it.

type ElectorView added in v0.1.0

type ElectorView struct {
	Node        string   `json:"node"`
	Role        string   `json:"role,omitempty" jsonschema:"leader, candidate, follower, or unclustered (its view is too small to elect)"`
	Term        uint64   `json:"term,omitzero"`
	Leader      string   `json:"leader,omitempty" jsonschema:"the node it follows; empty while it knows none"`
	VotedFor    string   `json:"voted_for,omitempty"`
	View        []string `json:"view,omitempty" jsonschema:"the nodes whose majority elects"`
	Quorum      int      `json:"quorum,omitzero"`
	State       string   `` /* 136-byte string literal not displayed */
	Cordoned    []string `json:"cordoned,omitempty" jsonschema:"nodes that may not lead"`
	Unreachable []string `json:"unreachable,omitempty" jsonschema:"nodes of its view it has not heard from since it lost them"`
	Singleton   string   `json:"singleton,omitempty" jsonschema:"the singleton: its pid on the leader, or none, starting, stopping"`
	Backoff     string   `json:"backoff,omitempty" jsonschema:"how long it holds off campaigning: after its singleton failed, or after it handed over"`
	Error       string   `json:"error,omitempty" jsonschema:"why the node could not be asked"`
}

ElectorView is one node's part in a grpcproc/leader election, as its elector says: comparing the nodes is how a split view shows.

type EventView

type EventView struct {
	Time    string       `json:"time"`
	Kind    string       `json:"kind" jsonschema:"spawn, exit, link-up, link-down, dead-letter, member-up or member-down"`
	Missed  uint64       `json:"missed,omitzero" jsonschema:"events lost before this one"`
	Process *ProcessView `json:"process,omitempty"`
	Reason  string       `json:"reason,omitempty"`
	Peer    string       `json:"peer,omitempty"`
	Error   string       `json:"error,omitempty"`
	From    string       `json:"from,omitempty"`
	To      string       `json:"to,omitempty"`
	Type    string       `json:"type,omitempty" jsonschema:"message type of a dead letter"`
	Member  *MemberView  `json:"member,omitempty" jsonschema:"the member listed, or listed no more"`
}

EventView is something that happened on a node.

type Filter

type Filter struct {
	Name       string // substring of a registered name
	Label      string
	State      string // idle, running, waiting-reply, exiting
	MinMailbox int
}

Filter narrows Processes; zero fields match everything.

type GroupMembersView added in v0.13.0

type GroupMembersView struct {
	Node    string   `json:"node"`
	Scope   string   `json:"scope"`
	Group   string   `json:"group"`
	Members []string `json:"members" jsonschema:"their pids, ordered by node"`
	Omitted int      `json:"omitted,omitzero" jsonschema:"members left out past the limit"`
}

GroupMembersView is one group's members, as one node's copy has them.

type GroupPeerView added in v0.13.0

type GroupPeerView struct {
	Node    string `json:"node"`
	State   string `` /* 171-byte string literal not displayed */
	Scope   string `json:"scope,omitempty" jsonschema:"its scope's pid, once synced"`
	Members int    `json:"members" jsonschema:"its processes' memberships, in every group"`
}

GroupPeerView is another node's scope, as this one knows it.

type GroupView added in v0.13.0

type GroupView struct {
	Name    string `json:"name"`
	Members int    `json:"members" jsonschema:"its members on every node"`
	Local   int    `json:"local" jsonschema:"its members on the node whose copy this is"`
	Nodes   int    `json:"nodes" jsonschema:"nodes with a member"`
}

GroupView is one group's counts.

type GroupsView added in v0.13.0

type GroupsView struct {
	Node    string          `json:"node" jsonschema:"the node whose copy of the groups this is"`
	Scope   string          `json:"scope"`
	PID     string          `json:"pid" jsonschema:"the scope's process"`
	Scopes  []string        `json:"scopes" jsonschema:"every scope the node runs"`
	Groups  []GroupView     `json:"groups"`
	Omitted int             `json:"omitted,omitzero" jsonschema:"groups left out past the limit"`
	Peers   []GroupPeerView `json:"peers" jsonschema:"the other nodes the scope knows"`
}

GroupsView is a grpcproc/groups scope's groups, as one node's copy has them.

type LinkTotalsView added in v0.12.0

type LinkTotalsView struct {
	Group            string   `` /* 163-byte string literal not displayed */
	Peers            int      `json:"peers" jsonschema:"peers with a link either way"`
	PeersDown        int      `json:"peers_down,omitzero" jsonschema:"peers whose every link is down"`
	Outbound         int      `json:"outbound"`
	OutboundUp       int      `json:"outbound_up"`
	OutboundDown     int      `json:"outbound_down,omitzero"`
	Inbound          int      `json:"inbound"`
	MessagesSent     uint64   `json:"messages_sent"`
	BytesSent        uint64   `json:"bytes_sent"`
	MessagesReceived uint64   `json:"messages_received"`
	BytesReceived    uint64   `json:"bytes_received"`
	Queued           int      `json:"queued,omitzero" jsonschema:"messages waiting to be written to these peers"`
	QueuedBytes      int      `json:"queued_bytes,omitzero"`
	Reconnects       uint64   `json:"reconnects,omitzero"`
	Down             []string `json:"down,omitempty" jsonschema:"the first of the peers that are down, by name, at most 16"`
}

LinkTotalsView is a node's links with a group of its peers, added up.

type LinkView

type LinkView struct {
	Peer        string `json:"peer"`
	Incarnation uint64 `json:"incarnation" jsonschema:"the peer's incarnation; 0 until a dial to it succeeds"`
	Direction   string `json:"direction" jsonschema:"out: this node sends on it; in: the peer does"`
	State       string `json:"state"`
	Age         string `json:"age,omitempty"`
	Reconnects  uint64 `json:"reconnects"`
	Messages    uint64 `json:"messages"`
	Bytes       uint64 `json:"bytes"`
	Queued      int    `` /* 244-byte string literal not displayed */
	QueuedBytes int    `` /* 134-byte string literal not displayed */
	RetryIn     string `` /* 200-byte string literal not displayed */
	LastError   string `json:"last_error,omitempty"`
}

LinkView is one direction of traffic with a peer.

type MemberView added in v0.11.0

type MemberView struct {
	Name        string            `json:"name"`
	Incarnation uint64            `json:"incarnation,omitzero" jsonschema:"0 when the Membership does not know it"`
	Addr        string            `json:"addr,omitempty" jsonschema:"where peers dial it"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

MemberView is a node as a node's Membership reports it.

type NameView added in v0.5.0

type NameView struct {
	Name string `json:"name"`
	PID  string `json:"pid" jsonschema:"the process that holds it"`
}

NameView is a global name and the process that holds it.

type NodeView

type NodeView struct {
	Name        string            `json:"name" jsonschema:"node name"`
	Incarnation uint64            `json:"incarnation,omitzero" jsonschema:"changes every time the node starts"`
	Advertise   string            `json:"advertise,omitempty" jsonschema:"address peers dial"`
	Metadata    map[string]string `` /* 126-byte string literal not displayed */
	Uptime      string            `json:"uptime,omitempty"`
	Processes   int               `json:"processes"`
	Spawned     uint64            `json:"spawned"`
	Exited      uint64            `json:"exited"`
	DeadLetters uint64            `json:"dead_letters" jsonschema:"messages that could not be delivered"`
	Links       []LinkView        `json:"links,omitzero" jsonschema:"absent when only added up, in link_totals"`
	LinkTotals  []LinkTotalsView  `json:"link_totals,omitempty" jsonschema:"its links added up, by a key of its peers' metadata or all together"`
	Members     []MemberView      `` /* 169-byte string literal not displayed */
	Error       string            `json:"error,omitempty" jsonschema:"why the node could not be inspected"`
	Unanswered  bool              `` /* 142-byte string literal not displayed */
	NoInspector bool              `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

NodeView is a node as grpcprocctl shows it and its MCP tools return it.

func (NodeView) Problem added in v0.12.0

func (v NodeView) Problem() string

Problem says why the node is not described: its Error, NotAnswered or NotInspected.

func (NodeView) Reached added in v0.12.0

func (v NodeView) Reached() bool

Reached is whether the node was described: it answered, and serves an Inspector.

type ProcessView

type ProcessView struct {
	PID           string            `json:"pid"`
	Name          string            `json:"name,omitempty" jsonschema:"the name it is registered under, if any"`
	Label         string            `json:"label" jsonschema:"what metrics aggregate by; the message type by default"`
	Type          string            `json:"type" jsonschema:"Go type of the messages it accepts"`
	Parent        string            `json:"parent,omitempty" jsonschema:"the process that started it, such as its supervisor"`
	Globals       []string          `json:"globals,omitempty" jsonschema:"the installation's global names it holds"`
	State         string            `json:"state" jsonschema:"idle (waiting in Receive), running, waiting-reply (in a Call), exiting"`
	Uptime        string            `json:"uptime"`
	Mailbox       int               `json:"mailbox" jsonschema:"messages waiting"`
	MailboxPeak   int               `json:"mailbox_peak"`
	OldestWait    string            `json:"oldest_wait,omitempty" jsonschema:"how long the oldest waiting message has waited"`
	Received      uint64            `json:"received"`
	Sent          uint64            `json:"sent"`
	CallsInFlight uint32            `json:"calls_in_flight,omitzero"`
	BusySeconds   float64           `` /* 269-byte string literal not displayed */
	BusyFor       string            `` /* 187-byte string literal not displayed */
	LastMessage   string            `json:"last_message,omitempty" jsonschema:"type of the last message it took"`
	Monitors      int               `json:"monitors,omitzero" jsonschema:"processes it watches"`
	Links         int               `` /* 126-byte string literal not displayed */
	TrapExit      bool              `json:"trap_exit,omitzero" jsonschema:"whether the exits of processes it is linked to reach it as messages"`
	Watchers      int               `json:"watchers,omitzero" jsonschema:"processes monitoring or linked to it"`
	LogLevel      string            `json:"log_level"`
	Inspect       map[string]string `json:"inspect,omitempty" jsonschema:"what the process says about itself"`
	InspectError  string            `json:"inspect_error,omitempty" jsonschema:"why inspect is empty: busy, or gone"`
}

ProcessView is a process as grpcprocctl shows it and its MCP tools return it.

type SagaEngineView added in v0.10.0

type SagaEngineView struct {
	Node string `json:"node"`
	// Process is the engine's registered name, or its pid.
	Process string   `json:"process"`
	PID     string   `json:"pid"`
	Sagas   []string `json:"sagas" jsonschema:"the sagas it runs, each as name vN, its version"`
	Working int      `json:"working" jsonschema:"runs it works on now"`
	Error   string   `json:"error,omitempty" jsonschema:"why it could not be read: it is busy, or gone, or its node could not be asked"`
}

SagaEngineView is a grpcproc/saga engine and the sagas it runs.

type SagaQuery added in v0.10.0

type SagaQuery struct {
	Saga   string   // one saga, or every one the engine runs
	Status []string // active, done, stuck; all of them when none
	Limit  int      // how many, 100 when 0, at most 1000
	// AfterSaga and AfterID name the last run of the previous page, for the
	// next; AfterSaga is Saga when empty.
	AfterSaga, AfterID string
}

SagaQuery is which runs SagaRuns lists.

type SagaRunView added in v0.10.0

type SagaRunView struct {
	Saga    string `json:"saga"`
	ID      string `json:"id"`
	Version uint64 `json:"version,omitzero" jsonschema:"the highest version of the saga that began, signalled or worked on it"`
	State   string `json:"state" jsonschema:"the state of the saga's machine it is in"`
	Status  string `` /* 163-byte string literal not displayed */
	// Data is the run's data as JSON, asked for one run of an engine that
	// shows data (saga.Config.InspectData); left out when it shows none, or
	// cannot read it.
	Data        any          `json:"data,omitzero"`
	DataOmitted uint64       `json:"data_omitted,omitzero" jsonschema:"the size of the data when it is too large to carry: data is then left out"`
	Waiting     uint32       `json:"waiting,omitzero" jsonschema:"how many signals wait, in a list, which carries the count and not the signals"`
	Visit       uint64       `json:"visit,omitzero" jsonschema:"how many states it has entered"`
	EffectDone  bool         `json:"effect_done,omitzero" jsonschema:"the state's effect is through for this visit, and the run waits"`
	Attempts    int64        `json:"attempts,omitzero" jsonschema:"how many times the effect failed in this visit"`
	Error       string       `json:"error,omitempty" jsonschema:"why the effect failed last, or why the run is stuck"`
	Cause       string       `json:"cause,omitempty" jsonschema:"the error an Otherwise last fired with: why the run left its way"`
	Wake        string       `json:"wake,omitempty" jsonschema:"when it is next due"`
	RetryAt     string       `json:"retry_at,omitempty" jsonschema:"when its failed effect is next tried"`
	Deadline    string       `json:"deadline,omitempty" jsonschema:"when the timer of its visit fires"`
	Owner       string       `json:"owner,omitempty" jsonschema:"the node of the engine working on it"`
	LeaseUntil  string       `json:"lease_until,omitempty"`
	Epoch       uint64       `json:"epoch,omitzero" jsonschema:"how many times it has been claimed"`
	Inbox       []SagaSignal `json:"inbox,omitempty" jsonschema:"signals waiting for a state that takes them"`
	Revision    uint64       `json:"revision"`
	Created     string       `json:"created,omitempty"`
	Updated     string       `json:"updated,omitempty"`
}

SagaRunView is a run of a saga, as its store keeps it.

type SagaSignal added in v0.10.0

type SagaSignal struct {
	Seq     uint64 `json:"seq"`
	Event   string `json:"event"`
	Payload any    `` /* 174-byte string literal not displayed */
	Omitted uint64 `json:"payload_omitted,omitzero" jsonschema:"the size of the payload when it is too large to carry: payload is then left out"`
	Version uint64 `json:"version,omitzero"`
}

SagaSignal is a signal waiting in a run's inbox.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL