hsmtest

package
v1.26.2-122.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TaskType = "test-task-type-name"

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

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

func NewData

func NewData(
	state State,
) *Data

func (*Data) RegenerateTasks

func (d *Data) RegenerateTasks(node *hsm.Node) ([]hsm.Task, error)

func (*Data) SetState

func (d *Data) SetState(s State)

func (*Data) State

func (d *Data) State() State

type Definition

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

func NewDefinition

func NewDefinition(typeName string) Definition

func (Definition) CompareState

func (d Definition) CompareState(s1 any, s2 any) (int, error)

func (Definition) Deserialize

func (d Definition) Deserialize(b []byte) (any, error)

func (Definition) Serialize

func (d Definition) Serialize(s any) ([]byte, error)

Serialize implements hsm.StateMachineDefinition.

func (Definition) Type

func (d Definition) Type() string

Type implements hsm.StateMachineDefinition.

type NodeBackend

type NodeBackend struct {
	Events []*historypb.HistoryEvent
}

func (*NodeBackend) AddHistoryEvent

func (n *NodeBackend) AddHistoryEvent(t enumspb.EventType, setAttributes func(*historypb.HistoryEvent)) *historypb.HistoryEvent

func (*NodeBackend) GenerateEventLoadToken

func (n *NodeBackend) GenerateEventLoadToken(event *historypb.HistoryEvent) ([]byte, error)

func (*NodeBackend) GetCurrentVersion

func (n *NodeBackend) GetCurrentVersion() int64

func (*NodeBackend) LoadHistoryEvent

func (n *NodeBackend) LoadHistoryEvent(ctx context.Context, tokenBytes []byte) (*historypb.HistoryEvent, error)

func (*NodeBackend) NextTransitionCount

func (n *NodeBackend) NextTransitionCount() int64

type State

type State string
const (
	State1 State = "state1"
	State2 State = "state2"
	State3 State = "state3"
	State4 State = "state4"
)

type Task

type Task struct {
	IsConcurrent bool
	// contains filtered or unexported fields
}

func NewTask

func NewTask(
	kind hsm.TaskKind,
	concurrent bool,
) *Task

func (*Task) Concurrent

func (t *Task) Concurrent() bool

func (*Task) Kind

func (t *Task) Kind() hsm.TaskKind

func (*Task) Type

func (t *Task) Type() string

type TaskSerializer

type TaskSerializer struct{}

func (TaskSerializer) Deserialize

func (s TaskSerializer) Deserialize(b []byte, kind hsm.TaskKind) (hsm.Task, error)

func (TaskSerializer) Serialize

func (s TaskSerializer) Serialize(t hsm.Task) ([]byte, error)

Jump to

Keyboard shortcuts

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