fz

package module
v0.0.0-...-a3c7ef9 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrActionNotRegistered = errors.New("action not registered")

Functions

func RandBetween

func RandBetween[T constraints.Integer, T2 constraints.Integer](target *T, lower T2, upper T2)

func RandBool

func RandBool[T ~bool](target *T)

func RegisterAction

func RegisterAction(value any)

Types

type Action

type Action interface {
}

func RandomActionTree

func RandomActionTree(
	makers []ActionMaker,
	numActions int,
) Action

type ActionMaker

type ActionMaker = func() Action

type Cleanup

type Cleanup func()

func (Cleanup) Reduce

func (_ Cleanup) Reduce(_ dscope.Scope, vs []reflect.Value) reflect.Value

type ConfigItems

type ConfigItems []any

func (ConfigItems) Reduce

func (_ ConfigItems) Reduce(_ dscope.Scope, vs []reflect.Value) reflect.Value

type CreatedAt

type CreatedAt string

type Def

type Def struct{}

func (Def) CPUProfile

func (_ Def) CPUProfile(
	enable EnableCPUProfile,
) Operators

func (Def) CreatedAt

func (_ Def) CreatedAt() CreatedAt

func (Def) CreatedAtConfigItem

func (_ Def) CreatedAtConfigItem(
	t CreatedAt,
) ConfigItems

func (Def) DoAction

func (_ Def) DoAction(
	do Do,
) (
	doAction doAction,
)

func (Def) DumbCleanup

func (_ Def) DumbCleanup() Cleanup

func (Def) DumbExecuteFuncs

func (_ Def) DumbExecuteFuncs() (
	_ Start,
	_ Stop,
	_ Do,
)

func (Def) EnableCPUProfile

func (_ Def) EnableCPUProfile() EnableCPUProfile

func (Def) EnableCPUProfileConfig

func (_ Def) EnableCPUProfileConfig(
	enable EnableCPUProfile,
) ConfigItems

func (Def) Execute

func (_ Def) Execute(
	start Start,
	stop Stop,
	do Do,
	mainAction MainAction,
	ops Operators,
	doAction doAction,
	scope dscope.Scope,
) Execute

func (Def) MainActionConfigItem

func (_ Def) MainActionConfigItem(
	action MainAction,
) ConfigItems

func (Def) NamedConfigItems

func (_ Def) NamedConfigItems(
	items ConfigItems,
) (
	nameds []NamedConfigItem,
	m map[string]NamedConfigItem,
)

func (Def) ReadConfig

func (_ Def) ReadConfig(
	nameds map[string]NamedConfigItem,
) ReadConfig

func (Def) TempDir

func (_ Def) TempDir() (
	dir TempDir,
	cleanup Cleanup,
)

func (Def) UUID

func (_ Def) UUID() uuid.UUID

func (Def) UUIDConfigItem

func (_ Def) UUIDConfigItem(
	id uuid.UUID,
) ConfigItems

func (Def) WriteConfig

func (_ Def) WriteConfig(
	nameds []NamedConfigItem,
) WriteConfig

type Do

type Do func(action Action) error

type EnableCPUProfile

type EnableCPUProfile bool

type Execute

type Execute func() error

type MainAction

type MainAction struct {
	Action Action
}

func (*MainAction) UnmarshalXML

func (t *MainAction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

type NamedConfigItem

type NamedConfigItem struct {
	Name  string
	Value any
}

type Operator

type Operator struct {
	BeforeStart any
	BeforeDo    any
	AfterDo     any
	AfterStop   any
	Finally     any
}

func SaveAllocsProfile

func SaveAllocsProfile(filename string) Operator

func SaveCPUProfile

func SaveCPUProfile(filename string) Operator

func SaveConfig

func SaveConfig(filename string) Operator

type Operators

type Operators []Operator

func (Operators) Reduce

func (c Operators) Reduce(_ dscope.Scope, vs []reflect.Value) reflect.Value

type ParallelAction

type ParallelAction struct {
	Actions []Action
}

func Par

func Par(actions ...Action) ParallelAction

func (ParallelAction) MarshalXML

func (s ParallelAction) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

func (*ParallelAction) UnmarshalXML

func (s *ParallelAction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

type ReadConfig

type ReadConfig func(r io.Reader) ([]any, error)

type SequentialAction

type SequentialAction struct {
	Actions []Action
}

func Seq

func Seq(actions ...Action) SequentialAction

func (SequentialAction) MarshalXML

func (s SequentialAction) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

func (*SequentialAction) UnmarshalXML

func (s *SequentialAction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

type Start

type Start func() error

type Stop

type Stop func() error

type TempDir

type TempDir string

type WriteConfig

type WriteConfig func(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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