hsmtest

package
v1.25.0-114.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskTypeID   = int32(4321)
	TaskTypeName = "test-task-type-name"
)

Variables

View Source
var (
	TaskType = hsm.TaskType{
		ID:   TaskTypeID,
		Name: TaskTypeName,
	}
)

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(typeID int32) Definition

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() hsm.MachineType

Type implements hsm.StateMachineDefinition.

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() hsm.TaskType

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