monitoralpb

package
v0.0.0-...-2c66b35 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostWorkflowName               = "monitoral.v1.Monitoral.HostWorkflow"
	SystemWorkflowName             = "monitoral.v1.Monitoral.SystemWorkflow"
	HostRunActivityName            = "monitoral.v1.Monitoral.HostRunActivity"
	HostUpdateConfigActivityName   = "monitoral.v1.Monitoral.HostUpdateConfigActivity"
	HostCollectActivityName        = "monitoral.v1.Monitoral.HostCollectActivity"
	SystemUpdateConfigActivityName = "monitoral.v1.Monitoral.SystemUpdateConfigActivity"
	SystemGetNotificationsName     = "monitoral.v1.Monitoral.SystemGetNotifications"
	SystemGetConfigName            = "monitoral.v1.Monitoral.SystemGetConfig"
	HostRunName                    = "monitoral.v1.Monitoral.HostRun"
	HostUpdateConfigName           = "monitoral.v1.Monitoral.HostUpdateConfig"
	HostDoneName                   = "monitoral.v1.Monitoral.HostDone"
	SystemUpdateConfigName         = "monitoral.v1.Monitoral.SystemUpdateConfig"
	SystemUpdateNotificationsName  = "monitoral.v1.Monitoral.SystemUpdateNotifications"
	HostCollectSignalName          = "monitoral.v1.Monitoral.HostCollect"
	HostCollectResponseName        = HostCollectSignalName + "-response"
)

Constants used as workflow, activity, query, and signal names.

Variables

View Source
var File_monitoralpb_monitoral_proto protoreflect.FileDescriptor

Functions

func BuildHostWorkflow

func BuildHostWorkflow(newImpl func(workflow.Context, *HostWorkflowInput) (HostWorkflowImpl, error)) func(ctx workflow.Context, req *HostWorkflowRequest) error

BuildHostWorkflow returns a function for the given impl.

func BuildSystemWorkflow

func BuildSystemWorkflow(newImpl func(workflow.Context, *SystemWorkflowInput) (SystemWorkflowImpl, error)) func(ctx workflow.Context, req *SystemWorkflowRequest) error

BuildSystemWorkflow returns a function for the given impl.

func HostDoneExternal

func HostDoneExternal(ctx workflow.Context, workflowID, runID string, req *HostDoneRequest) workflow.Future

Signal sent when the host is known to be done. This is sent with a signal-with-start so that it can make a new successfully closed workflow on top of a failed one if necessary.

func HostRunExternal

func HostRunExternal(ctx workflow.Context, workflowID, runID string, req *HostRunRequest) workflow.Future

HostRun is sent as signal-with-start to HostWorkflow to start or restart the long-running activity on the host with the given task queue. If it is a restart, the existing activity is expected to be cancelled if running.

func HostUpdateConfigExternal

func HostUpdateConfigExternal(ctx workflow.Context, workflowID, runID string, req *HostUpdateConfigRequest) workflow.Future

HostUpdateConfig requests the workflow to update the given configurations. This is usually called from an activity from the system workflow to update config.

There is a known race condition where a config can be updated on the system workflow while a host is just getting started and therefore the host may not by in the list to update. It is encumbent upon the host workflow starter to wait a reasonable amount of time after the workflow is started and check that the config didn't change or if it did, re-deliver the signal.

func RegisterActivities

func RegisterActivities(r worker.ActivityRegistry, a ActivitiesImpl)

RegisterActivities registers all activities in the interface.

func RegisterHostCollectActivity

func RegisterHostCollectActivity(r worker.ActivityRegistry, impl func(context.Context, *HostCollectRequest) (*HostCollectResponse, error))

RegisterHostCollectActivity registers the single activity.

func RegisterHostRunActivity

func RegisterHostRunActivity(r worker.ActivityRegistry, impl func(context.Context, *HostRunRequest) (*HostRunRequest, error))

RegisterHostRunActivity registers the single activity.

func RegisterHostUpdateConfigActivity

func RegisterHostUpdateConfigActivity(r worker.ActivityRegistry, impl func(context.Context, *HostUpdateConfigRequest) error)

RegisterHostUpdateConfigActivity registers the single activity.

func RegisterHostWorkflow

func RegisterHostWorkflow(r worker.WorkflowRegistry, newImpl func(workflow.Context, *HostWorkflowInput) (HostWorkflowImpl, error))

RegisterHostWorkflow registers a workflow with the given impl.

func RegisterSystemUpdateConfigActivity

func RegisterSystemUpdateConfigActivity(r worker.ActivityRegistry, impl func(context.Context, *SystemUpdateConfigRequest) error)

RegisterSystemUpdateConfigActivity registers the single activity.

func RegisterSystemWorkflow

func RegisterSystemWorkflow(r worker.WorkflowRegistry, newImpl func(workflow.Context, *SystemWorkflowInput) (SystemWorkflowImpl, error))

RegisterSystemWorkflow registers a workflow with the given impl.

func SystemUpdateConfigExternal

func SystemUpdateConfigExternal(ctx workflow.Context, workflowID, runID string, req *SystemUpdateConfigRequest) workflow.Future

SystemUpdateConfig is the signal to update the entire config.

func SystemUpdateNotificationsExternal

func SystemUpdateNotificationsExternal(ctx workflow.Context, workflowID, runID string, req *SystemUpdateNotificationsRequest) workflow.Future

SystemUpdateNotifications creates/updates notifications.

Types

type ActivitiesImpl

type ActivitiesImpl interface {

	// HostRunActivity is the long-running activity on the host. This only returns
	// successfully on cancel and the value can be used to call again to resume
	// where left off.
	HostRunActivity(context.Context, *HostRunRequest) (*HostRunRequest, error)

	// HostUpdateConfigActivity is the update activity triggered by the signal.
	HostUpdateConfigActivity(context.Context, *HostUpdateConfigRequest) error

	// HostCollectActivity is the collect activity triggered by the call.
	HostCollectActivity(context.Context, *HostCollectRequest) (*HostCollectResponse, error)

	// SystemUpdateConfigActivity is the update activity triggered by the signal.
	SystemUpdateConfigActivity(context.Context, *SystemUpdateConfigRequest) error
}

ActivitiesImpl is an interface for activity implementations.

type CallResponseHandler

type CallResponseHandler interface {
	// TaskQueue returns the task queue for response activities.
	TaskQueue() string

	// PrepareCall creates a new ID and channels to receive response/error.
	// Each channel only has a buffer of one and are never closed and only one is ever sent to.
	// If context is closed, the context error is returned on error channel.
	PrepareCall(ctx context.Context) (id string, chOk <-chan interface{}, chErr <-chan error)

	// AddResponseType adds an activity for the given type and ID field.
	// Does not error if activity name already exists for the same params.
	AddResponseType(activityName string, typ reflect.Type, idField string) error
}

CallResponseHandler handles activity responses.

type Client

type Client interface {

	// HostWorkflow runs on the system task queue and maintains a long-running
	// activity on the host. This will contain the following search attributes:
	// * "monitoral-host" - Hostname
	// * "monitoral-tags" - String array of tags
	ExecuteHostWorkflow(ctx context.Context, opts *client.StartWorkflowOptions, req *HostWorkflowRequest) (HostWorkflowRun, error)

	// GetHostWorkflow returns an existing run started by ExecuteHostWorkflow.
	GetHostWorkflow(ctx context.Context, workflowID, runID string) (HostWorkflowRun, error)

	// SystemWorkflow is the single workflow for managing config and
	// notifications.
	ExecuteSystemWorkflow(ctx context.Context, opts *client.StartWorkflowOptions, req *SystemWorkflowRequest) (SystemWorkflowRun, error)

	// GetSystemWorkflow returns an existing run started by ExecuteSystemWorkflow.
	GetSystemWorkflow(ctx context.Context, workflowID, runID string) (SystemWorkflowRun, error)

	// SystemGetNotifications returns notifications.
	SystemGetNotifications(ctx context.Context, workflowID, runID string, req *SystemGetNotificationsRequest) (*SystemGetNotificationsResponse, error)

	// SystemGetConfig returns the current system config.
	SystemGetConfig(ctx context.Context, workflowID, runID string, req *SystemGetConfigRequest) (*SystemGetConfigResponse, error)

	// HostRun is sent as signal-with-start to HostWorkflow to start or restart
	// the long-running activity on the host with the given task queue. If it is a
	// restart, the existing activity is expected to be cancelled if
	// running.
	HostRun(ctx context.Context, workflowID, runID string, req *HostRunRequest) error

	// HostUpdateConfig requests the workflow to update the given configurations.
	// This is usually called from an activity from the system workflow to update
	// config.
	//
	// There is a known race condition where a config can be updated on the system
	// workflow while a host is just getting started and therefore the host may
	// not by in the list to update. It is encumbent upon the host workflow
	// starter to wait a reasonable amount of time after the workflow is started
	// and check that the config didn't change or if it did, re-deliver the
	// signal.
	HostUpdateConfig(ctx context.Context, workflowID, runID string, req *HostUpdateConfigRequest) error

	// Signal sent when the host is known to be done. This is sent with a
	// signal-with-start so that it can make a new successfully closed workflow
	// on top of a failed one if necessary.
	HostDone(ctx context.Context, workflowID, runID string, req *HostDoneRequest) error

	// SystemUpdateConfig is the signal to update the entire config.
	SystemUpdateConfig(ctx context.Context, workflowID, runID string, req *SystemUpdateConfigRequest) error

	// SystemUpdateNotifications creates/updates notifications.
	SystemUpdateNotifications(ctx context.Context, workflowID, runID string, req *SystemUpdateNotificationsRequest) error

	// HostCollect manually collects latest metrics for the host.
	HostCollect(ctx context.Context, workflowID, runID string, req *HostCollectRequest) (*HostCollectResponse, error)
}

func NewClient

func NewClient(opts ClientOptions) Client

NewClient creates a new Client.

type ClientOptions

type ClientOptions struct {
	// Required client.
	Client client.Client
	// Handler that must be present for client calls to succeed.
	CallResponseHandler CallResponseHandler
}

ClientOptions are used for NewClient.

type HostCollect

type HostCollect struct{ Channel workflow.ReceiveChannel }

HostCollect manually collects latest metrics for the host.

func (HostCollect) Receive

Receive blocks until call is received.

func (HostCollect) ReceiveAsync

func (s HostCollect) ReceiveAsync() *HostCollectRequest

ReceiveAsync returns received signal or nil if none.

func (HostCollect) Respond

Respond sends a response. Activity options not used if request received via another workflow. If activity options needed and not present, they are taken from the context.

func (HostCollect) Select

Select adds the callback to the selector to be invoked when signal received. Callback can be nil

type HostCollectActivityFuture

type HostCollectActivityFuture struct{ Future workflow.Future }

HostCollectActivityFuture represents completion of the activity.

func HostCollectActivity

HostCollectActivity is the collect activity triggered by the call.

func HostCollectActivityLocal

HostCollectActivity is the collect activity triggered by the call.

func (HostCollectActivityFuture) Get

Get waits for completion.

func (HostCollectActivityFuture) Select

Select adds the completion to the selector. Callback can be nil.

type HostCollectRequest

type HostCollectRequest struct {

	// If empty, assumes all exported metrics
	Metrics []string `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// Both of these are inclusive, neither are required.
	CollectedSince *durationpb.Duration `protobuf:"bytes,2,opt,name=collected_since,json=collectedSince,proto3" json:"collected_since,omitempty"`
	CollectedUntil *durationpb.Duration `protobuf:"bytes,3,opt,name=collected_until,json=collectedUntil,proto3" json:"collected_until,omitempty"`
	// If true, only the latest metric per name is given.
	LatestOnly bool `protobuf:"varint,4,opt,name=latest_only,json=latestOnly,proto3" json:"latest_only,omitempty"`
	// Metadata needed for a "call"
	Id                 string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
	ResponseTaskQueue  string `protobuf:"bytes,6,opt,name=response_task_queue,json=responseTaskQueue,proto3" json:"response_task_queue,omitempty"`
	ResponseWorkflowId string `protobuf:"bytes,7,opt,name=response_workflow_id,json=responseWorkflowId,proto3" json:"response_workflow_id,omitempty"`
	// contains filtered or unexported fields
}

func (*HostCollectRequest) Descriptor deprecated

func (*HostCollectRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostCollectRequest.ProtoReflect.Descriptor instead.

func (*HostCollectRequest) GetCollectedSince

func (x *HostCollectRequest) GetCollectedSince() *durationpb.Duration

func (*HostCollectRequest) GetCollectedUntil

func (x *HostCollectRequest) GetCollectedUntil() *durationpb.Duration

func (*HostCollectRequest) GetId

func (x *HostCollectRequest) GetId() string

func (*HostCollectRequest) GetLatestOnly

func (x *HostCollectRequest) GetLatestOnly() bool

func (*HostCollectRequest) GetMetrics

func (x *HostCollectRequest) GetMetrics() []string

func (*HostCollectRequest) GetResponseTaskQueue

func (x *HostCollectRequest) GetResponseTaskQueue() string

func (*HostCollectRequest) GetResponseWorkflowId

func (x *HostCollectRequest) GetResponseWorkflowId() string

func (*HostCollectRequest) ProtoMessage

func (*HostCollectRequest) ProtoMessage()

func (*HostCollectRequest) ProtoReflect

func (x *HostCollectRequest) ProtoReflect() protoreflect.Message

func (*HostCollectRequest) Reset

func (x *HostCollectRequest) Reset()

func (*HostCollectRequest) String

func (x *HostCollectRequest) String() string

type HostCollectResponse

type HostCollectResponse struct {
	Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// No metrics present if there is an error
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// Metadata needed for a "call"
	Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*HostCollectResponse) Descriptor deprecated

func (*HostCollectResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostCollectResponse.ProtoReflect.Descriptor instead.

func (*HostCollectResponse) GetError

func (x *HostCollectResponse) GetError() string

func (*HostCollectResponse) GetId

func (x *HostCollectResponse) GetId() string

func (*HostCollectResponse) GetMetrics

func (x *HostCollectResponse) GetMetrics() []*Metric

func (*HostCollectResponse) ProtoMessage

func (*HostCollectResponse) ProtoMessage()

func (*HostCollectResponse) ProtoReflect

func (x *HostCollectResponse) ProtoReflect() protoreflect.Message

func (*HostCollectResponse) Reset

func (x *HostCollectResponse) Reset()

func (*HostCollectResponse) String

func (x *HostCollectResponse) String() string

type HostCollectResponseExternal

type HostCollectResponseExternal struct {
	Future  workflow.Future
	Channel workflow.ReceiveChannel
}

HostCollectResponseExternal represents a call response.

func HostCollectExternal

func HostCollectExternal(ctx workflow.Context, workflowID, runID string, req *HostCollectRequest) (HostCollectResponseExternal, error)

HostCollect manually collects latest metrics for the host.

func (HostCollectResponseExternal) Receive

Receive blocks until response is received.

func (HostCollectResponseExternal) ReceiveAsync

ReceiveAsync returns response or nil if none.

func (HostCollectResponseExternal) Select

Select adds the callback to the selector to be invoked when response received. Callback can be nil

func (HostCollectResponseExternal) SelectSent

SelectSent adds when a request is sent to the selector. Callback can be nil.

func (HostCollectResponseExternal) WaitSent

WaitSent blocks until the request is sent.

type HostConfig

type HostConfig struct {
	Tag     string               `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	Metrics []*HostConfig_Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// contains filtered or unexported fields
}

func (*HostConfig) Descriptor deprecated

func (*HostConfig) Descriptor() ([]byte, []int)

Deprecated: Use HostConfig.ProtoReflect.Descriptor instead.

func (*HostConfig) GetMetrics

func (x *HostConfig) GetMetrics() []*HostConfig_Metric

func (*HostConfig) GetTag

func (x *HostConfig) GetTag() string

func (*HostConfig) ProtoMessage

func (*HostConfig) ProtoMessage()

func (*HostConfig) ProtoReflect

func (x *HostConfig) ProtoReflect() protoreflect.Message

func (*HostConfig) Reset

func (x *HostConfig) Reset()

func (*HostConfig) String

func (x *HostConfig) String() string

type HostConfig_Exec

type HostConfig_Exec struct {

	// Types that are assignable to Exec:
	//	*HostConfig_Exec_SqlQueryTemplate
	Exec isHostConfig_Exec_Exec `protobuf_oneof:"exec"`
	// contains filtered or unexported fields
}

func (*HostConfig_Exec) Descriptor deprecated

func (*HostConfig_Exec) Descriptor() ([]byte, []int)

Deprecated: Use HostConfig_Exec.ProtoReflect.Descriptor instead.

func (*HostConfig_Exec) GetExec

func (m *HostConfig_Exec) GetExec() isHostConfig_Exec_Exec

func (*HostConfig_Exec) GetSqlQueryTemplate

func (x *HostConfig_Exec) GetSqlQueryTemplate() string

func (*HostConfig_Exec) ProtoMessage

func (*HostConfig_Exec) ProtoMessage()

func (*HostConfig_Exec) ProtoReflect

func (x *HostConfig_Exec) ProtoReflect() protoreflect.Message

func (*HostConfig_Exec) Reset

func (x *HostConfig_Exec) Reset()

func (*HostConfig_Exec) String

func (x *HostConfig_Exec) String() string

type HostConfig_Exec_SqlQueryTemplate

type HostConfig_Exec_SqlQueryTemplate struct {
	// For regular metrics, the set of queries herein should delete to enforce
	// retention and insert for the collected value. For alerting metrics,
	// this should usually also select values for return as the last query.
	SqlQueryTemplate string `protobuf:"bytes,1,opt,name=sql_query_template,json=sqlQueryTemplate,proto3,oneof"`
}

type HostConfig_Metric

type HostConfig_Metric struct {
	Name        string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string               `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Exec        *HostConfig_Exec     `protobuf:"bytes,3,opt,name=exec,proto3" json:"exec,omitempty"`
	ExecFreq    *durationpb.Duration `protobuf:"bytes,4,opt,name=exec_freq,json=execFreq,proto3" json:"exec_freq,omitempty"`
	Exported    bool                 `protobuf:"varint,5,opt,name=exported,proto3" json:"exported,omitempty"`
	// If true, and rows returned from the last query will trigger an alert. If
	// the query constantly flaps (i.e. returns a value then doesn't), a lot of
	// alerts will occur. It is currently the query writer's responsibility to
	// do whatever is necessary to prevent flapping (e.g. store state and wait
	// until after so long).
	// TODO(cretz): How best to report the detailed alerting data?
	AlertIfResults bool `protobuf:"varint,6,opt,name=alert_if_results,json=alertIfResults,proto3" json:"alert_if_results,omitempty"`
	// contains filtered or unexported fields
}

func (*HostConfig_Metric) Descriptor deprecated

func (*HostConfig_Metric) Descriptor() ([]byte, []int)

Deprecated: Use HostConfig_Metric.ProtoReflect.Descriptor instead.

func (*HostConfig_Metric) GetAlertIfResults

func (x *HostConfig_Metric) GetAlertIfResults() bool

func (*HostConfig_Metric) GetDescription

func (x *HostConfig_Metric) GetDescription() string

func (*HostConfig_Metric) GetExec

func (x *HostConfig_Metric) GetExec() *HostConfig_Exec

func (*HostConfig_Metric) GetExecFreq

func (x *HostConfig_Metric) GetExecFreq() *durationpb.Duration

func (*HostConfig_Metric) GetExported

func (x *HostConfig_Metric) GetExported() bool

func (*HostConfig_Metric) GetName

func (x *HostConfig_Metric) GetName() string

func (*HostConfig_Metric) ProtoMessage

func (*HostConfig_Metric) ProtoMessage()

func (*HostConfig_Metric) ProtoReflect

func (x *HostConfig_Metric) ProtoReflect() protoreflect.Message

func (*HostConfig_Metric) Reset

func (x *HostConfig_Metric) Reset()

func (*HostConfig_Metric) String

func (x *HostConfig_Metric) String() string

type HostDone

type HostDone struct{ Channel workflow.ReceiveChannel }

Signal sent when the host is known to be done. This is sent with a signal-with-start so that it can make a new successfully closed workflow on top of a failed one if necessary.

func (HostDone) Receive

func (s HostDone) Receive(ctx workflow.Context) *HostDoneRequest

Receive blocks until signal is received.

func (HostDone) ReceiveAsync

func (s HostDone) ReceiveAsync() *HostDoneRequest

ReceiveAsync returns received signal or nil if none.

func (HostDone) Select

func (s HostDone) Select(sel workflow.Selector, fn func(*HostDoneRequest)) workflow.Selector

Select adds the callback to the selector to be invoked when signal received. Callback can be nil.

type HostDoneRequest

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

func (*HostDoneRequest) Descriptor deprecated

func (*HostDoneRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostDoneRequest.ProtoReflect.Descriptor instead.

func (*HostDoneRequest) ProtoMessage

func (*HostDoneRequest) ProtoMessage()

func (*HostDoneRequest) ProtoReflect

func (x *HostDoneRequest) ProtoReflect() protoreflect.Message

func (*HostDoneRequest) Reset

func (x *HostDoneRequest) Reset()

func (*HostDoneRequest) String

func (x *HostDoneRequest) String() string

type HostRun

type HostRun struct{ Channel workflow.ReceiveChannel }

HostRun is sent as signal-with-start to HostWorkflow to start or restart the long-running activity on the host with the given task queue. If it is a restart, the existing activity is expected to be cancelled if running.

func (HostRun) Receive

func (s HostRun) Receive(ctx workflow.Context) *HostRunRequest

Receive blocks until signal is received.

func (HostRun) ReceiveAsync

func (s HostRun) ReceiveAsync() *HostRunRequest

ReceiveAsync returns received signal or nil if none.

func (HostRun) Select

func (s HostRun) Select(sel workflow.Selector, fn func(*HostRunRequest)) workflow.Selector

Select adds the callback to the selector to be invoked when signal received. Callback can be nil.

type HostRunActivityFuture

type HostRunActivityFuture struct{ Future workflow.Future }

HostRunActivityFuture represents completion of the activity.

func HostRunActivity

HostRunActivity is the long-running activity on the host. This only returns successfully on cancel and the value can be used to call again to resume where left off.

func HostRunActivityLocal

HostRunActivity is the long-running activity on the host. This only returns successfully on cancel and the value can be used to call again to resume where left off.

func (HostRunActivityFuture) Get

Get waits for completion.

func (HostRunActivityFuture) Select

Select adds the completion to the selector. Callback can be nil.

type HostRunRequest

type HostRunRequest struct {

	// This should be unique every time the host worker process is started
	TaskQueue string `protobuf:"bytes,1,opt,name=task_queue,json=taskQueue,proto3" json:"task_queue,omitempty"`
	// This may be older than one from update config request, so the workflow is
	// responsible for only using the newest. Always greater than 0.
	ConfigMutationSeq uint64        `protobuf:"varint,2,opt,name=config_mutation_seq,json=configMutationSeq,proto3" json:"config_mutation_seq,omitempty"`
	Configs           []*HostConfig `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"`
	PrevRunSnapshot   []byte        `protobuf:"bytes,4,opt,name=prev_run_snapshot,json=prevRunSnapshot,proto3" json:"prev_run_snapshot,omitempty"`
	// contains filtered or unexported fields
}

func (*HostRunRequest) Descriptor deprecated

func (*HostRunRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostRunRequest.ProtoReflect.Descriptor instead.

func (*HostRunRequest) GetConfigMutationSeq

func (x *HostRunRequest) GetConfigMutationSeq() uint64

func (*HostRunRequest) GetConfigs

func (x *HostRunRequest) GetConfigs() []*HostConfig

func (*HostRunRequest) GetPrevRunSnapshot

func (x *HostRunRequest) GetPrevRunSnapshot() []byte

func (*HostRunRequest) GetTaskQueue

func (x *HostRunRequest) GetTaskQueue() string

func (*HostRunRequest) ProtoMessage

func (*HostRunRequest) ProtoMessage()

func (*HostRunRequest) ProtoReflect

func (x *HostRunRequest) ProtoReflect() protoreflect.Message

func (*HostRunRequest) Reset

func (x *HostRunRequest) Reset()

func (*HostRunRequest) String

func (x *HostRunRequest) String() string

type HostUpdateConfig

type HostUpdateConfig struct{ Channel workflow.ReceiveChannel }

HostUpdateConfig requests the workflow to update the given configurations. This is usually called from an activity from the system workflow to update config.

There is a known race condition where a config can be updated on the system workflow while a host is just getting started and therefore the host may not by in the list to update. It is encumbent upon the host workflow starter to wait a reasonable amount of time after the workflow is started and check that the config didn't change or if it did, re-deliver the signal.

func (HostUpdateConfig) Receive

Receive blocks until signal is received.

func (HostUpdateConfig) ReceiveAsync

func (s HostUpdateConfig) ReceiveAsync() *HostUpdateConfigRequest

ReceiveAsync returns received signal or nil if none.

func (HostUpdateConfig) Select

Select adds the callback to the selector to be invoked when signal received. Callback can be nil.

type HostUpdateConfigActivityFuture

type HostUpdateConfigActivityFuture struct{ Future workflow.Future }

HostUpdateConfigActivityFuture represents completion of the activity.

func HostUpdateConfigActivity

HostUpdateConfigActivity is the update activity triggered by the signal.

func HostUpdateConfigActivityLocal

HostUpdateConfigActivity is the update activity triggered by the signal.

func (HostUpdateConfigActivityFuture) Get

Get waits for completion.

func (HostUpdateConfigActivityFuture) Select

Select adds the completion to the selector. Callback can be nil.

type HostUpdateConfigRequest

type HostUpdateConfigRequest struct {

	// May not be sequential, but should be discarded if this is before the last
	// received seq. Always greater than 0.
	MutationSeq uint64 `protobuf:"varint,1,opt,name=mutation_seq,json=mutationSeq,proto3" json:"mutation_seq,omitempty"`
	// This is the full set of known configs for the tags. This means on update
	// a tag can be not present here which means a deleted config.
	Configs []*HostConfig `protobuf:"bytes,2,rep,name=configs,proto3" json:"configs,omitempty"`
	// contains filtered or unexported fields
}

func (*HostUpdateConfigRequest) Descriptor deprecated

func (*HostUpdateConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostUpdateConfigRequest.ProtoReflect.Descriptor instead.

func (*HostUpdateConfigRequest) GetConfigs

func (x *HostUpdateConfigRequest) GetConfigs() []*HostConfig

func (*HostUpdateConfigRequest) GetMutationSeq

func (x *HostUpdateConfigRequest) GetMutationSeq() uint64

func (*HostUpdateConfigRequest) ProtoMessage

func (*HostUpdateConfigRequest) ProtoMessage()

func (*HostUpdateConfigRequest) ProtoReflect

func (x *HostUpdateConfigRequest) ProtoReflect() protoreflect.Message

func (*HostUpdateConfigRequest) Reset

func (x *HostUpdateConfigRequest) Reset()

func (*HostUpdateConfigRequest) String

func (x *HostUpdateConfigRequest) String() string

type HostWorkflowChildRun

type HostWorkflowChildRun struct{ Future workflow.ChildWorkflowFuture }

HostWorkflowChildRun is a future for the child workflow.

func HostWorkflowChild

HostWorkflowChild executes a child workflow. If options not present, they are taken from the context.

func (HostWorkflowChildRun) Get

Get returns the completed workflow value, waiting if necessary.

func (HostWorkflowChildRun) HostCollect

HostCollect manually collects latest metrics for the host.

func (HostWorkflowChildRun) HostDone

Signal sent when the host is known to be done. This is sent with a signal-with-start so that it can make a new successfully closed workflow on top of a failed one if necessary.

func (HostWorkflowChildRun) HostRun

HostRun is sent as signal-with-start to HostWorkflow to start or restart the long-running activity on the host with the given task queue. If it is a restart, the existing activity is expected to be cancelled if running.

func (HostWorkflowChildRun) HostUpdateConfig

HostUpdateConfig requests the workflow to update the given configurations. This is usually called from an activity from the system workflow to update config.

There is a known race condition where a config can be updated on the system workflow while a host is just getting started and therefore the host may not by in the list to update. It is encumbent upon the host workflow starter to wait a reasonable amount of time after the workflow is started and check that the config didn't change or if it did, re-deliver the signal.

func (HostWorkflowChildRun) Select

Select adds this completion to the selector. Callback can be nil.

func (HostWorkflowChildRun) SelectStart

SelectStart adds waiting for start to the selector. Callback can be nil.

func (HostWorkflowChildRun) WaitStart

WaitStart waits for the child workflow to start.

type HostWorkflowImpl

type HostWorkflowImpl interface {
	Run(workflow.Context) error
}

HostWorkflow runs on the system task queue and maintains a long-running activity on the host. This will contain the following search attributes: * "monitoral-host" - Hostname * "monitoral-tags" - String array of tags

type HostWorkflowInput

type HostWorkflowInput struct {
	Req              *HostWorkflowRequest
	HostRun          HostRun
	HostUpdateConfig HostUpdateConfig
	HostDone         HostDone
	HostCollect      HostCollect
}

HostWorkflowInput is input provided to HostWorkflowImpl.Run.

type HostWorkflowRequest

type HostWorkflowRequest struct {

	// Should only be set on continue-as-new
	ContinueRunRequest *HostRunRequest `protobuf:"bytes,1,opt,name=continue_run_request,json=continueRunRequest,proto3" json:"continue_run_request,omitempty"`
	// contains filtered or unexported fields
}

func (*HostWorkflowRequest) Descriptor deprecated

func (*HostWorkflowRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostWorkflowRequest.ProtoReflect.Descriptor instead.

func (*HostWorkflowRequest) GetContinueRunRequest

func (x *HostWorkflowRequest) GetContinueRunRequest() *HostRunRequest

func (*HostWorkflowRequest) ProtoMessage

func (*HostWorkflowRequest) ProtoMessage()

func (*HostWorkflowRequest) ProtoReflect

func (x *HostWorkflowRequest) ProtoReflect() protoreflect.Message

func (*HostWorkflowRequest) Reset

func (x *HostWorkflowRequest) Reset()

func (*HostWorkflowRequest) String

func (x *HostWorkflowRequest) String() string

type HostWorkflowRun

type HostWorkflowRun interface {
	// ID is the workflow ID.
	ID() string

	// RunID is the workflow run ID.
	RunID() string

	// Get returns the completed workflow value, waiting if necessary.
	Get(ctx context.Context) error

	// HostRun is sent as signal-with-start to HostWorkflow to start or restart
	// the long-running activity on the host with the given task queue. If it is a
	// restart, the existing activity is expected to be cancelled if
	// running.
	HostRun(ctx context.Context, req *HostRunRequest) error

	// HostUpdateConfig requests the workflow to update the given configurations.
	// This is usually called from an activity from the system workflow to update
	// config.
	//
	// There is a known race condition where a config can be updated on the system
	// workflow while a host is just getting started and therefore the host may
	// not by in the list to update. It is encumbent upon the host workflow
	// starter to wait a reasonable amount of time after the workflow is started
	// and check that the config didn't change or if it did, re-deliver the
	// signal.
	HostUpdateConfig(ctx context.Context, req *HostUpdateConfigRequest) error

	// Signal sent when the host is known to be done. This is sent with a
	// signal-with-start so that it can make a new successfully closed workflow
	// on top of a failed one if necessary.
	HostDone(ctx context.Context, req *HostDoneRequest) error

	// HostCollect manually collects latest metrics for the host.
	HostCollect(ctx context.Context, req *HostCollectRequest) (*HostCollectResponse, error)
}

HostWorkflowRun represents an execution of HostWorkflow.

type Metric

type Metric struct {
	Name        string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	CollectedOn *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=collected_on,json=collectedOn,proto3" json:"collected_on,omitempty"`
	Value       *anypb.Any             `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	Labels      map[string]string      `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Metric) Descriptor deprecated

func (*Metric) Descriptor() ([]byte, []int)

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetCollectedOn

func (x *Metric) GetCollectedOn() *timestamppb.Timestamp

func (*Metric) GetLabels

func (x *Metric) GetLabels() map[string]string

func (*Metric) GetName

func (x *Metric) GetName() string

func (*Metric) GetValue

func (x *Metric) GetValue() *anypb.Any

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

func (x *Metric) ProtoReflect() protoreflect.Message

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

type Notification

type Notification struct {

	// Automatically populated if empty on update
	Id   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	// Only the latest of the name is active
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are assignable to Detail:
	//	*Notification_AlertStarted
	//	*Notification_AlertStopped
	//	*Notification_ActivityStarted
	//	*Notification_ActivityDone
	//	*Notification_ActivityStopped
	Detail isNotification_Detail `protobuf_oneof:"detail"`
	// Automatically populated if empty on update
	StartedOn *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=started_on,json=startedOn,proto3" json:"started_on,omitempty"`
	Notes     string                 `protobuf:"bytes,10,opt,name=notes,proto3" json:"notes,omitempty"`
	Labels    map[string]string      `` /* 154-byte string literal not displayed */
	// Automatically defaulted to true when first seen
	Visible bool `protobuf:"varint,12,opt,name=visible,proto3" json:"visible,omitempty"`
	// This is a system controlled value, cannot be mutated. Is only true if there
	// is an active alert, activity start, or activity stop.
	Active bool `protobuf:"varint,13,opt,name=active,proto3" json:"active,omitempty"`
	// contains filtered or unexported fields
}

func (*Notification) Descriptor deprecated

func (*Notification) Descriptor() ([]byte, []int)

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetActive

func (x *Notification) GetActive() bool

func (*Notification) GetActivityDone

func (x *Notification) GetActivityDone() *Notification_StatusChange

func (*Notification) GetActivityStarted

func (x *Notification) GetActivityStarted() *Notification_StatusChange

func (*Notification) GetActivityStopped

func (x *Notification) GetActivityStopped() *Notification_StatusChange

func (*Notification) GetAlertStarted

func (x *Notification) GetAlertStarted() *Notification_AlertChange

func (*Notification) GetAlertStopped

func (x *Notification) GetAlertStopped() *Notification_AlertChange

func (*Notification) GetDetail

func (m *Notification) GetDetail() isNotification_Detail

func (*Notification) GetHost

func (x *Notification) GetHost() string

func (*Notification) GetId

func (x *Notification) GetId() string

func (*Notification) GetLabels

func (x *Notification) GetLabels() map[string]string

func (*Notification) GetName

func (x *Notification) GetName() string

func (*Notification) GetNotes

func (x *Notification) GetNotes() string

func (*Notification) GetStartedOn

func (x *Notification) GetStartedOn() *timestamppb.Timestamp

func (*Notification) GetVisible

func (x *Notification) GetVisible() bool

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

func (x *Notification) ProtoReflect() protoreflect.Message

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

type Notification_ActivityDone

type Notification_ActivityDone struct {
	// Automatically marks all of the same host+name inactive including alerts.
	ActivityDone *Notification_StatusChange `protobuf:"bytes,7,opt,name=activity_done,json=activityDone,proto3,oneof"`
}

type Notification_ActivityStarted

type Notification_ActivityStarted struct {
	// Automatically marked active when received. All alerts are marked
	// inactive.
	ActivityStarted *Notification_StatusChange `protobuf:"bytes,6,opt,name=activity_started,json=activityStarted,proto3,oneof"`
}

type Notification_ActivityStopped

type Notification_ActivityStopped struct {
	// Automatically marked active when received. All alerts are marked
	// inactive.
	ActivityStopped *Notification_StatusChange `protobuf:"bytes,8,opt,name=activity_stopped,json=activityStopped,proto3,oneof"`
}

type Notification_AlertChange

type Notification_AlertChange struct {
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // TODO(cretz): How best to report data?
	// contains filtered or unexported fields
}

func (*Notification_AlertChange) Descriptor deprecated

func (*Notification_AlertChange) Descriptor() ([]byte, []int)

Deprecated: Use Notification_AlertChange.ProtoReflect.Descriptor instead.

func (*Notification_AlertChange) GetDescription

func (x *Notification_AlertChange) GetDescription() string

func (*Notification_AlertChange) ProtoMessage

func (*Notification_AlertChange) ProtoMessage()

func (*Notification_AlertChange) ProtoReflect

func (x *Notification_AlertChange) ProtoReflect() protoreflect.Message

func (*Notification_AlertChange) Reset

func (x *Notification_AlertChange) Reset()

func (*Notification_AlertChange) String

func (x *Notification_AlertChange) String() string

type Notification_AlertStarted

type Notification_AlertStarted struct {
	// Automatically marked active when received
	AlertStarted *Notification_AlertChange `protobuf:"bytes,4,opt,name=alert_started,json=alertStarted,proto3,oneof"`
}

type Notification_AlertStopped

type Notification_AlertStopped struct {
	// Automatically marks all of the same host+name inactive
	AlertStopped *Notification_AlertChange `protobuf:"bytes,5,opt,name=alert_stopped,json=alertStopped,proto3,oneof"`
}

type Notification_StatusChange

type Notification_StatusChange struct {
	Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*Notification_StatusChange) Descriptor deprecated

func (*Notification_StatusChange) Descriptor() ([]byte, []int)

Deprecated: Use Notification_StatusChange.ProtoReflect.Descriptor instead.

func (*Notification_StatusChange) GetReason

func (x *Notification_StatusChange) GetReason() string

func (*Notification_StatusChange) ProtoMessage

func (*Notification_StatusChange) ProtoMessage()

func (*Notification_StatusChange) ProtoReflect

func (*Notification_StatusChange) Reset

func (x *Notification_StatusChange) Reset()

func (*Notification_StatusChange) String

func (x *Notification_StatusChange) String() string

type SystemConfig

type SystemConfig struct {
	HostConfigs []*HostConfig `protobuf:"bytes,1,rep,name=host_configs,json=hostConfigs,proto3" json:"host_configs,omitempty"`
	// Defaults to a reasonable number
	MaxNotifications uint32 `protobuf:"varint,2,opt,name=max_notifications,json=maxNotifications,proto3" json:"max_notifications,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemConfig) Descriptor deprecated

func (*SystemConfig) Descriptor() ([]byte, []int)

Deprecated: Use SystemConfig.ProtoReflect.Descriptor instead.

func (*SystemConfig) GetHostConfigs

func (x *SystemConfig) GetHostConfigs() []*HostConfig

func (*SystemConfig) GetMaxNotifications

func (x *SystemConfig) GetMaxNotifications() uint32

func (*SystemConfig) ProtoMessage

func (*SystemConfig) ProtoMessage()

func (*SystemConfig) ProtoReflect

func (x *SystemConfig) ProtoReflect() protoreflect.Message

func (*SystemConfig) Reset

func (x *SystemConfig) Reset()

func (*SystemConfig) String

func (x *SystemConfig) String() string

type SystemGetConfigRequest

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

func (*SystemGetConfigRequest) Descriptor deprecated

func (*SystemGetConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use SystemGetConfigRequest.ProtoReflect.Descriptor instead.

func (*SystemGetConfigRequest) ProtoMessage

func (*SystemGetConfigRequest) ProtoMessage()

func (*SystemGetConfigRequest) ProtoReflect

func (x *SystemGetConfigRequest) ProtoReflect() protoreflect.Message

func (*SystemGetConfigRequest) Reset

func (x *SystemGetConfigRequest) Reset()

func (*SystemGetConfigRequest) String

func (x *SystemGetConfigRequest) String() string

type SystemGetConfigResponse

type SystemGetConfigResponse struct {

	// May not be sequential, but can be used to determine order. Always greater
	// than 0.
	MutationSeq uint64 `protobuf:"varint,1,opt,name=mutation_seq,json=mutationSeq,proto3" json:"mutation_seq,omitempty"`
	// Replaces entire existing config
	Config *SystemConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemGetConfigResponse) Descriptor deprecated

func (*SystemGetConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use SystemGetConfigResponse.ProtoReflect.Descriptor instead.

func (*SystemGetConfigResponse) GetConfig

func (x *SystemGetConfigResponse) GetConfig() *SystemConfig

func (*SystemGetConfigResponse) GetMutationSeq

func (x *SystemGetConfigResponse) GetMutationSeq() uint64

func (*SystemGetConfigResponse) ProtoMessage

func (*SystemGetConfigResponse) ProtoMessage()

func (*SystemGetConfigResponse) ProtoReflect

func (x *SystemGetConfigResponse) ProtoReflect() protoreflect.Message

func (*SystemGetConfigResponse) Reset

func (x *SystemGetConfigResponse) Reset()

func (*SystemGetConfigResponse) String

func (x *SystemGetConfigResponse) String() string

type SystemGetNotificationsRequest

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

func (*SystemGetNotificationsRequest) Descriptor deprecated

func (*SystemGetNotificationsRequest) Descriptor() ([]byte, []int)

Deprecated: Use SystemGetNotificationsRequest.ProtoReflect.Descriptor instead.

func (*SystemGetNotificationsRequest) ProtoMessage

func (*SystemGetNotificationsRequest) ProtoMessage()

func (*SystemGetNotificationsRequest) ProtoReflect

func (*SystemGetNotificationsRequest) Reset

func (x *SystemGetNotificationsRequest) Reset()

func (*SystemGetNotificationsRequest) String

type SystemGetNotificationsResponse

type SystemGetNotificationsResponse struct {
	Notification          []*Notification `protobuf:"bytes,1,rep,name=notification,proto3" json:"notification,omitempty"`
	ArchivedNotifications uint64          `protobuf:"varint,3,opt,name=archived_notifications,json=archivedNotifications,proto3" json:"archived_notifications,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemGetNotificationsResponse) Descriptor deprecated

func (*SystemGetNotificationsResponse) Descriptor() ([]byte, []int)

Deprecated: Use SystemGetNotificationsResponse.ProtoReflect.Descriptor instead.

func (*SystemGetNotificationsResponse) GetArchivedNotifications

func (x *SystemGetNotificationsResponse) GetArchivedNotifications() uint64

func (*SystemGetNotificationsResponse) GetNotification

func (x *SystemGetNotificationsResponse) GetNotification() []*Notification

func (*SystemGetNotificationsResponse) ProtoMessage

func (*SystemGetNotificationsResponse) ProtoMessage()

func (*SystemGetNotificationsResponse) ProtoReflect

func (*SystemGetNotificationsResponse) Reset

func (x *SystemGetNotificationsResponse) Reset()

func (*SystemGetNotificationsResponse) String

type SystemUpdateConfig

type SystemUpdateConfig struct{ Channel workflow.ReceiveChannel }

SystemUpdateConfig is the signal to update the entire config.

func (SystemUpdateConfig) Receive

Receive blocks until signal is received.

func (SystemUpdateConfig) ReceiveAsync

ReceiveAsync returns received signal or nil if none.

func (SystemUpdateConfig) Select

Select adds the callback to the selector to be invoked when signal received. Callback can be nil.

type SystemUpdateConfigActivityFuture

type SystemUpdateConfigActivityFuture struct{ Future workflow.Future }

SystemUpdateConfigActivityFuture represents completion of the activity.

func SystemUpdateConfigActivity

SystemUpdateConfigActivity is the update activity triggered by the signal.

func SystemUpdateConfigActivityLocal

SystemUpdateConfigActivity is the update activity triggered by the signal.

func (SystemUpdateConfigActivityFuture) Get

Get waits for completion.

func (SystemUpdateConfigActivityFuture) Select

Select adds the completion to the selector. Callback can be nil.

type SystemUpdateConfigRequest

type SystemUpdateConfigRequest struct {
	Config *SystemConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemUpdateConfigRequest) Descriptor deprecated

func (*SystemUpdateConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use SystemUpdateConfigRequest.ProtoReflect.Descriptor instead.

func (*SystemUpdateConfigRequest) GetConfig

func (x *SystemUpdateConfigRequest) GetConfig() *SystemConfig

func (*SystemUpdateConfigRequest) ProtoMessage

func (*SystemUpdateConfigRequest) ProtoMessage()

func (*SystemUpdateConfigRequest) ProtoReflect

func (*SystemUpdateConfigRequest) Reset

func (x *SystemUpdateConfigRequest) Reset()

func (*SystemUpdateConfigRequest) String

func (x *SystemUpdateConfigRequest) String() string

type SystemUpdateNotifications

type SystemUpdateNotifications struct{ Channel workflow.ReceiveChannel }

SystemUpdateNotifications creates/updates notifications.

func (SystemUpdateNotifications) Receive

Receive blocks until signal is received.

func (SystemUpdateNotifications) ReceiveAsync

ReceiveAsync returns received signal or nil if none.

func (SystemUpdateNotifications) Select

Select adds the callback to the selector to be invoked when signal received. Callback can be nil.

type SystemUpdateNotificationsRequest

type SystemUpdateNotificationsRequest struct {
	Notifications []*Notification `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemUpdateNotificationsRequest) Descriptor deprecated

func (*SystemUpdateNotificationsRequest) Descriptor() ([]byte, []int)

Deprecated: Use SystemUpdateNotificationsRequest.ProtoReflect.Descriptor instead.

func (*SystemUpdateNotificationsRequest) GetNotifications

func (x *SystemUpdateNotificationsRequest) GetNotifications() []*Notification

func (*SystemUpdateNotificationsRequest) ProtoMessage

func (*SystemUpdateNotificationsRequest) ProtoMessage()

func (*SystemUpdateNotificationsRequest) ProtoReflect

func (*SystemUpdateNotificationsRequest) Reset

func (*SystemUpdateNotificationsRequest) String

type SystemWorkflowChildRun

type SystemWorkflowChildRun struct{ Future workflow.ChildWorkflowFuture }

SystemWorkflowChildRun is a future for the child workflow.

func SystemWorkflowChild

SystemWorkflowChild executes a child workflow. If options not present, they are taken from the context.

func (SystemWorkflowChildRun) Get

Get returns the completed workflow value, waiting if necessary.

func (SystemWorkflowChildRun) Select

Select adds this completion to the selector. Callback can be nil.

func (SystemWorkflowChildRun) SelectStart

SelectStart adds waiting for start to the selector. Callback can be nil.

func (SystemWorkflowChildRun) SystemUpdateConfig

SystemUpdateConfig is the signal to update the entire config.

func (SystemWorkflowChildRun) SystemUpdateNotifications

SystemUpdateNotifications creates/updates notifications.

func (SystemWorkflowChildRun) WaitStart

WaitStart waits for the child workflow to start.

type SystemWorkflowImpl

type SystemWorkflowImpl interface {
	Run(workflow.Context) error

	SystemGetNotifications(*SystemGetNotificationsRequest) (*SystemGetNotificationsResponse, error)

	SystemGetConfig(*SystemGetConfigRequest) (*SystemGetConfigResponse, error)
}

SystemWorkflow is the single workflow for managing config and notifications.

type SystemWorkflowInput

type SystemWorkflowInput struct {
	Req                       *SystemWorkflowRequest
	SystemUpdateConfig        SystemUpdateConfig
	SystemUpdateNotifications SystemUpdateNotifications
}

SystemWorkflowInput is input provided to SystemWorkflowImpl.Run.

type SystemWorkflowRequest

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

func (*SystemWorkflowRequest) Descriptor deprecated

func (*SystemWorkflowRequest) Descriptor() ([]byte, []int)

Deprecated: Use SystemWorkflowRequest.ProtoReflect.Descriptor instead.

func (*SystemWorkflowRequest) ProtoMessage

func (*SystemWorkflowRequest) ProtoMessage()

func (*SystemWorkflowRequest) ProtoReflect

func (x *SystemWorkflowRequest) ProtoReflect() protoreflect.Message

func (*SystemWorkflowRequest) Reset

func (x *SystemWorkflowRequest) Reset()

func (*SystemWorkflowRequest) String

func (x *SystemWorkflowRequest) String() string

type SystemWorkflowRun

type SystemWorkflowRun interface {
	// ID is the workflow ID.
	ID() string

	// RunID is the workflow run ID.
	RunID() string

	// Get returns the completed workflow value, waiting if necessary.
	Get(ctx context.Context) error

	// SystemGetNotifications returns notifications.
	SystemGetNotifications(ctx context.Context, req *SystemGetNotificationsRequest) (*SystemGetNotificationsResponse, error)

	// SystemGetConfig returns the current system config.
	SystemGetConfig(ctx context.Context, req *SystemGetConfigRequest) (*SystemGetConfigResponse, error)

	// SystemUpdateConfig is the signal to update the entire config.
	SystemUpdateConfig(ctx context.Context, req *SystemUpdateConfigRequest) error

	// SystemUpdateNotifications creates/updates notifications.
	SystemUpdateNotifications(ctx context.Context, req *SystemUpdateNotificationsRequest) error
}

SystemWorkflowRun represents an execution of SystemWorkflow.

Jump to

Keyboard shortcuts

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