ogcore

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func(ctx context.Context, state State) error

type Cloneable

type Cloneable interface {
	Node
	Clone() Cloneable
}

type Cluster

type Cluster interface {
	Join(nodes []Node)
}

type EventNode added in v0.7.0

type EventNode interface {
	Node
	AttachBus(bus *eventd.EventBus[State])
}

type EventTrace

type EventTrace struct {
	NodeName  string
	Event     string
	Timestamp time.Time
}

type Factories

type Factories struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFactories

func NewFactories() *Factories

func (*Factories) Add

func (f *Factories) Add(name string, factory func() Node)

func (*Factories) Clear

func (f *Factories) Clear()

func (*Factories) Clone

func (f *Factories) Clone() *Factories

func (*Factories) Get

func (f *Factories) Get(name string) func() Node

func (*Factories) Remove

func (f *Factories) Remove(name string)

type Initializeable

type Initializeable interface {
	Init(params map[string]any) error
}

type Nameable

type Nameable interface {
	Name() string

	SetName(name string)
}

type Node

type Node interface {
	Run(ctx context.Context, state State) error
}

type State

type State interface {
	Get(key any) (any, bool)
	Set(key any, val any)
	Update(key any, updateFunc func(val any) any)
}

type Tracker

type Tracker struct {
	StartTime time.Time
	TraceData []EventTrace
}

func (*Tracker) Record

func (tracker *Tracker) Record(nodeName string, event string, timestamp time.Time)

type Transactional added in v0.7.0

type Transactional interface {
	Node
	Commit()
	Rollback()
}

type Wrapper

type Wrapper interface {
	Wrap(node Node)
}

Jump to

Keyboard shortcuts

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