statechartsv1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StateType_name = map[int32]string{
		0: "STATE_TYPE_UNSPECIFIED",
		1: "STATE_TYPE_BASIC",
		2: "STATE_TYPE_NORMAL",
		3: "STATE_TYPE_PARALLEL",
	}
	StateType_value = map[string]int32{
		"STATE_TYPE_UNSPECIFIED": 0,
		"STATE_TYPE_BASIC":       1,
		"STATE_TYPE_NORMAL":      2,
		"STATE_TYPE_PARALLEL":    3,
	}
)

Enum value maps for StateType.

View Source
var (
	MachineState_name = map[int32]string{
		0: "MACHINE_STATE_UNSPECIFIED",
		1: "MACHINE_STATE_RUNNING",
		2: "MACHINE_STATE_STOPPED",
	}
	MachineState_value = map[string]int32{
		"MACHINE_STATE_UNSPECIFIED": 0,
		"MACHINE_STATE_RUNNING":     1,
		"MACHINE_STATE_STOPPED":     2,
	}
)

Enum value maps for MachineState.

View Source
var File_statecharts_v1_statechart_service_proto protoreflect.FileDescriptor
View Source
var File_statecharts_v1_statecharts_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Action

type Action struct {

	// The label of the action.
	Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

Action is an action for a transition.

func (*Action) Descriptor deprecated

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

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) GetLabel

func (x *Action) GetLabel() string

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect

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

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type CreateMachineRequest

type CreateMachineRequest struct {

	// The ID of the statechart to create an instance from.
	StatechartId string `protobuf:"bytes,1,opt,name=statechart_id,json=statechartId,proto3" json:"statechart_id,omitempty"`
	// The initial context of the machine.
	Context *structpb.Struct `protobuf:"bytes,2,opt,name=context,proto3" json:"context,omitempty"`
	// contains filtered or unexported fields
}

A request to create a new machine.

func (*CreateMachineRequest) Descriptor deprecated

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

Deprecated: Use CreateMachineRequest.ProtoReflect.Descriptor instead.

func (*CreateMachineRequest) GetContext

func (x *CreateMachineRequest) GetContext() *structpb.Struct

func (*CreateMachineRequest) GetStatechartId

func (x *CreateMachineRequest) GetStatechartId() string

func (*CreateMachineRequest) ProtoMessage

func (*CreateMachineRequest) ProtoMessage()

func (*CreateMachineRequest) ProtoReflect

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

func (*CreateMachineRequest) Reset

func (x *CreateMachineRequest) Reset()

func (*CreateMachineRequest) String

func (x *CreateMachineRequest) String() string

type CreateMachineResponse

type CreateMachineResponse struct {

	// The created machine.
	Machine *Machine `protobuf:"bytes,1,opt,name=machine,proto3" json:"machine,omitempty"`
	// contains filtered or unexported fields
}

A response to a create machine request.

func (*CreateMachineResponse) Descriptor deprecated

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

Deprecated: Use CreateMachineResponse.ProtoReflect.Descriptor instead.

func (*CreateMachineResponse) GetMachine

func (x *CreateMachineResponse) GetMachine() *Machine

func (*CreateMachineResponse) ProtoMessage

func (*CreateMachineResponse) ProtoMessage()

func (*CreateMachineResponse) ProtoReflect

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

func (*CreateMachineResponse) Reset

func (x *CreateMachineResponse) Reset()

func (*CreateMachineResponse) String

func (x *CreateMachineResponse) String() string

type Event

type Event struct {

	// The label of the event.
	Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

Event is an event in a statechart.

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetLabel

func (x *Event) GetLabel() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type EventHistoryEntry

type EventHistoryEntry struct {

	// The event that occurred.
	Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// The timestamp of the transition.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The context of the event.
	Context *structpb.Struct `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
	// contains filtered or unexported fields
}

EventHistoryEntry is an entry in the event history of a machine.

func (*EventHistoryEntry) Descriptor deprecated

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

Deprecated: Use EventHistoryEntry.ProtoReflect.Descriptor instead.

func (*EventHistoryEntry) GetContext

func (x *EventHistoryEntry) GetContext() *structpb.Struct

func (*EventHistoryEntry) GetEvent

func (x *EventHistoryEntry) GetEvent() string

func (*EventHistoryEntry) GetTimestamp

func (x *EventHistoryEntry) GetTimestamp() *timestamppb.Timestamp

func (*EventHistoryEntry) ProtoMessage

func (*EventHistoryEntry) ProtoMessage()

func (*EventHistoryEntry) ProtoReflect

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

func (*EventHistoryEntry) Reset

func (x *EventHistoryEntry) Reset()

func (*EventHistoryEntry) String

func (x *EventHistoryEntry) String() string

type Guard

type Guard struct {

	// The guard expression.
	Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"`
	// contains filtered or unexported fields
}

Guard is a guard for a transition.

func (*Guard) Descriptor deprecated

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

Deprecated: Use Guard.ProtoReflect.Descriptor instead.

func (*Guard) GetExpression

func (x *Guard) GetExpression() string

func (*Guard) ProtoMessage

func (*Guard) ProtoMessage()

func (*Guard) ProtoReflect

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

func (*Guard) Reset

func (x *Guard) Reset()

func (*Guard) String

func (x *Guard) String() string

type Machine

type Machine struct {

	// The id of the machine.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The overall state of the machine.
	State MachineState `protobuf:"varint,2,opt,name=state,proto3,enum=statecharts.v1.MachineState" json:"state,omitempty"`
	// The context of the machine.
	Context *structpb.Struct `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
	// The statechart definition.
	Statechart *Statechart `protobuf:"bytes,4,opt,name=statechart,proto3" json:"statechart,omitempty"`
	// The current status of the machine.
	Status *StatechartStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	// The history of events that have occurred on the machine.
	EventHistory []*EventHistoryEntry `protobuf:"bytes,6,rep,name=event_history,json=eventHistory,proto3" json:"event_history,omitempty"`
	// The history of transitions that have occurred on the machine.
	TransitionHistory []*TransitionHistoryEntry `protobuf:"bytes,7,rep,name=transition_history,json=transitionHistory,proto3" json:"transition_history,omitempty"`
	// contains filtered or unexported fields
}

Machine is an instance of a statechart.

func (*Machine) Descriptor deprecated

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

Deprecated: Use Machine.ProtoReflect.Descriptor instead.

func (*Machine) GetContext

func (x *Machine) GetContext() *structpb.Struct

func (*Machine) GetEventHistory

func (x *Machine) GetEventHistory() []*EventHistoryEntry

func (*Machine) GetId

func (x *Machine) GetId() string

func (*Machine) GetState

func (x *Machine) GetState() MachineState

func (*Machine) GetStatechart

func (x *Machine) GetStatechart() *Statechart

func (*Machine) GetStatus

func (x *Machine) GetStatus() *StatechartStatus

func (*Machine) GetTransitionHistory

func (x *Machine) GetTransitionHistory() []*TransitionHistoryEntry

func (*Machine) ProtoMessage

func (*Machine) ProtoMessage()

func (*Machine) ProtoReflect

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

func (*Machine) Reset

func (x *Machine) Reset()

func (*Machine) String

func (x *Machine) String() string

type MachineState

type MachineState int32

MachineState encodes the high-level state of a statechart.

const (
	// The machine is in an unspecified state.
	MachineState_MACHINE_STATE_UNSPECIFIED MachineState = 0
	// The machine is in a running state.
	MachineState_MACHINE_STATE_RUNNING MachineState = 1
	// The machine is in a stopped state.
	MachineState_MACHINE_STATE_STOPPED MachineState = 2
)

func (MachineState) Descriptor

func (MachineState) Enum

func (x MachineState) Enum() *MachineState

func (MachineState) EnumDescriptor deprecated

func (MachineState) EnumDescriptor() ([]byte, []int)

Deprecated: Use MachineState.Descriptor instead.

func (MachineState) Number

func (MachineState) String

func (x MachineState) String() string

func (MachineState) Type

type State

type State struct {

	// The label of the state.
	Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	// The type of the state.
	Type StateType `protobuf:"varint,2,opt,name=type,proto3,enum=statecharts.v1.StateType" json:"type,omitempty"`
	// The sub-states. If a state has no sub-states, it is considered a BASIC state.
	Children []*State `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
	// The state is the initial state of its parent state.
	IsInitial bool `protobuf:"varint,4,opt,name=is_initial,json=isInitial,proto3" json:"is_initial,omitempty"`
	// The state is the final state of its parent state.
	IsFinal bool `protobuf:"varint,5,opt,name=is_final,json=isFinal,proto3" json:"is_final,omitempty"`
	// contains filtered or unexported fields
}

State is a state in a statechart.

func (*State) Descriptor deprecated

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

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetChildren

func (x *State) GetChildren() []*State

func (*State) GetIsFinal

func (x *State) GetIsFinal() bool

func (*State) GetIsInitial

func (x *State) GetIsInitial() bool

func (*State) GetLabel

func (x *State) GetLabel() string

func (*State) GetType

func (x *State) GetType() StateType

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect

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

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type StateRef

type StateRef struct {

	// The label of the state.
	Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

StateRef is a reference to a state.

func (*StateRef) Descriptor deprecated

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

Deprecated: Use StateRef.ProtoReflect.Descriptor instead.

func (*StateRef) GetLabel

func (x *StateRef) GetLabel() string

func (*StateRef) ProtoMessage

func (*StateRef) ProtoMessage()

func (*StateRef) ProtoReflect

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

func (*StateRef) Reset

func (x *StateRef) Reset()

func (*StateRef) String

func (x *StateRef) String() string

type StateType

type StateType int32

StateType describes the type of a state.

const (
	// Unspecified state type.
	StateType_STATE_TYPE_UNSPECIFIED StateType = 0
	// A basic state (has no sub-states).
	StateType_STATE_TYPE_BASIC StateType = 1
	// A normal state (has sub-states related by XOR semantics).
	StateType_STATE_TYPE_NORMAL StateType = 2
	// A parallel state (has sub-states related by AND semantics).
	StateType_STATE_TYPE_PARALLEL StateType = 3
)

func (StateType) Descriptor

func (StateType) Descriptor() protoreflect.EnumDescriptor

func (StateType) Enum

func (x StateType) Enum() *StateType

func (StateType) EnumDescriptor deprecated

func (StateType) EnumDescriptor() ([]byte, []int)

Deprecated: Use StateType.Descriptor instead.

func (StateType) Number

func (x StateType) Number() protoreflect.EnumNumber

func (StateType) String

func (x StateType) String() string

func (StateType) Type

type Statechart

type Statechart struct {

	// The top-level states in the statechart.
	States []*State `protobuf:"bytes,1,rep,name=states,proto3" json:"states,omitempty"`
	// Transitions is the set of transitions that connect the states.
	Transistions []*Transition `protobuf:"bytes,2,rep,name=transistions,proto3" json:"transistions,omitempty"`
	// Events is the set of events that transitions are triggered by.
	Events []*Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

Statechart definition.

func (*Statechart) Descriptor deprecated

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

Deprecated: Use Statechart.ProtoReflect.Descriptor instead.

func (*Statechart) GetEvents

func (x *Statechart) GetEvents() []*Event

func (*Statechart) GetStates

func (x *Statechart) GetStates() []*State

func (*Statechart) GetTransistions

func (x *Statechart) GetTransistions() []*Transition

func (*Statechart) ProtoMessage

func (*Statechart) ProtoMessage()

func (*Statechart) ProtoReflect

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

func (*Statechart) Reset

func (x *Statechart) Reset()

func (*Statechart) String

func (x *Statechart) String() string

type StatechartRegistry

type StatechartRegistry struct {

	// The registry of Statecharts.
	Statecharts map[string]*Statechart `` /* 163-byte string literal not displayed */
	// contains filtered or unexported fields
}

A registry of Statecharts.

func (*StatechartRegistry) Descriptor deprecated

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

Deprecated: Use StatechartRegistry.ProtoReflect.Descriptor instead.

func (*StatechartRegistry) GetStatecharts

func (x *StatechartRegistry) GetStatecharts() map[string]*Statechart

func (*StatechartRegistry) ProtoMessage

func (*StatechartRegistry) ProtoMessage()

func (*StatechartRegistry) ProtoReflect

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

func (*StatechartRegistry) Reset

func (x *StatechartRegistry) Reset()

func (*StatechartRegistry) String

func (x *StatechartRegistry) String() string

type StatechartStatus

type StatechartStatus struct {

	// The set of states in the status.
	States []*StateRef `protobuf:"bytes,1,rep,name=states,proto3" json:"states,omitempty"`
	// contains filtered or unexported fields
}

StatechartStatus is a status for a statechart which is defined by a subset of the states that are active.

func (*StatechartStatus) Descriptor deprecated

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

Deprecated: Use StatechartStatus.ProtoReflect.Descriptor instead.

func (*StatechartStatus) GetStates

func (x *StatechartStatus) GetStates() []*StateRef

func (*StatechartStatus) ProtoMessage

func (*StatechartStatus) ProtoMessage()

func (*StatechartStatus) ProtoReflect

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

func (*StatechartStatus) Reset

func (x *StatechartStatus) Reset()

func (*StatechartStatus) String

func (x *StatechartStatus) String() string

type StepRequest

type StepRequest struct {

	// The id of the statechart to step.
	StatechartId string `protobuf:"bytes,1,opt,name=statechart_id,json=statechartId,proto3" json:"statechart_id,omitempty"`
	// The event to step the statechart with.
	Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` // The context attached to the Event.
	// contains filtered or unexported fields
}

StepRequest is the request message for the Step method.

func (*StepRequest) Descriptor deprecated

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

Deprecated: Use StepRequest.ProtoReflect.Descriptor instead.

func (*StepRequest) GetEvent

func (x *StepRequest) GetEvent() string

func (*StepRequest) GetStatechartId

func (x *StepRequest) GetStatechartId() string

func (*StepRequest) ProtoMessage

func (*StepRequest) ProtoMessage()

func (*StepRequest) ProtoReflect

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

func (*StepRequest) Reset

func (x *StepRequest) Reset()

func (*StepRequest) String

func (x *StepRequest) String() string

type StepResponse

type StepResponse struct {

	// The statechart's current state.
	Machine *Machine `protobuf:"bytes,1,opt,name=machine,proto3" json:"machine,omitempty"`
	// The result of the step operation.
	Result *status.Status `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

StepResponse is the response message for the Step method.

func (*StepResponse) Descriptor deprecated

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

Deprecated: Use StepResponse.ProtoReflect.Descriptor instead.

func (*StepResponse) GetMachine

func (x *StepResponse) GetMachine() *Machine

func (*StepResponse) GetResult

func (x *StepResponse) GetResult() *status.Status

func (*StepResponse) ProtoMessage

func (*StepResponse) ProtoMessage()

func (*StepResponse) ProtoReflect

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

func (*StepResponse) Reset

func (x *StepResponse) Reset()

func (*StepResponse) String

func (x *StepResponse) String() string

type Transition

type Transition struct {

	// The from State reference.
	From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	// The to State
	To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	// The label of the event that triggers the transition.
	Event string `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"`
	// The guard of the transition.
	Guard *Guard `protobuf:"bytes,4,opt,name=guard,proto3" json:"guard,omitempty"`
	// The action(s) of the transition.
	Actions []*Action `protobuf:"bytes,5,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

Transition is a transition between states in a statechart.

func (*Transition) Descriptor deprecated

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

Deprecated: Use Transition.ProtoReflect.Descriptor instead.

func (*Transition) GetActions

func (x *Transition) GetActions() []*Action

func (*Transition) GetEvent

func (x *Transition) GetEvent() string

func (*Transition) GetFrom

func (x *Transition) GetFrom() string

func (*Transition) GetGuard

func (x *Transition) GetGuard() *Guard

func (*Transition) GetTo

func (x *Transition) GetTo() string

func (*Transition) ProtoMessage

func (*Transition) ProtoMessage()

func (*Transition) ProtoReflect

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

func (*Transition) Reset

func (x *Transition) Reset()

func (*Transition) String

func (x *Transition) String() string

type TransitionHistoryEntry

type TransitionHistoryEntry struct {

	// The transition that occurred.
	Transition string `protobuf:"bytes,1,opt,name=transition,proto3" json:"transition,omitempty"`
	// The timestamp of the transition.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The context of the transition.
	Context *structpb.Struct `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
	// contains filtered or unexported fields
}

TransitionHistoryEntry is an entry in the transition history of a machine.

func (*TransitionHistoryEntry) Descriptor deprecated

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

Deprecated: Use TransitionHistoryEntry.ProtoReflect.Descriptor instead.

func (*TransitionHistoryEntry) GetContext

func (x *TransitionHistoryEntry) GetContext() *structpb.Struct

func (*TransitionHistoryEntry) GetTimestamp

func (x *TransitionHistoryEntry) GetTimestamp() *timestamppb.Timestamp

func (*TransitionHistoryEntry) GetTransition

func (x *TransitionHistoryEntry) GetTransition() string

func (*TransitionHistoryEntry) ProtoMessage

func (*TransitionHistoryEntry) ProtoMessage()

func (*TransitionHistoryEntry) ProtoReflect

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

func (*TransitionHistoryEntry) Reset

func (x *TransitionHistoryEntry) Reset()

func (*TransitionHistoryEntry) String

func (x *TransitionHistoryEntry) String() string

Jump to

Keyboard shortcuts

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