runtime

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 4 Imported by: 16

README

runtime

Cryptellation RunTime Library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidMode is returned when the mode is invalid.
	ErrInvalidMode = errors.New("invalid mode")
)

Functions

func WithMode

func WithMode(ctx workflow.Context, mode Mode) workflow.Context

WithMode sets the mode in the context.

Types

type Context

type Context struct {
	ID        uuid.UUID
	Mode      Mode
	Now       time.Time
	TaskQueue string
}

Context is the context of a run that contains several information about the run.

type Mode

type Mode string

Mode is the mode in which a run is executed.

const (
	// ModeBacktest is the backtest mode.
	ModeBacktest Mode = "backtest"
	// ModeForwardtest is the forwardtest mode.
	ModeForwardtest Mode = "forwardtest"
	// ModeLive is the live mode.
	ModeLive Mode = "live"
)

func GetMode

func GetMode(ctx workflow.Context) Mode

GetMode returns the mode from the context.

func (Mode) String

func (m Mode) String() string

String returns the string representation of the mode.

func (Mode) Validate

func (m Mode) Validate() error

Validate validates the mode.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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