alpha

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VERSION = "alpha"
)

Functions

func New

func New() compose.Engine

func ParseParams

func ParseParams(ctx compose.Context, task Task) (*micheline.Prim, error)

func ParseScript

func ParseScript(ctx compose.Context, task Task) (*micheline.Script, error)

func RegisterTask

func RegisterTask(typ string, fn TaskFactory)

Types

type Account

type Account struct {
	Name string `yaml:"name"`
	Id   uint   `yaml:"id,omitempty"`
}

type Code

type Code struct {
	ValueSource `yaml:",inline"`
}

type Engine

type Engine struct{}

func (*Engine) Clone

func (e *Engine) Clone(ctx compose.Context, ops []compose.Op, cfg compose.CloneConfig) ([]byte, error)

func (*Engine) Run

func (e *Engine) Run(ctx compose.Context, fname string) error

func (*Engine) Validate

func (e *Engine) Validate(ctx compose.Context, fname string) error

type ErrorMode added in v1.18.0

type ErrorMode byte
const (
	ErrorModeFail ErrorMode = iota
	ErrorModeWarn
	ErrorModeIgnore
)

func (*ErrorMode) UnmarshalText added in v1.18.0

func (m *ErrorMode) UnmarshalText(buf []byte) error

func (*ErrorMode) UnmarshalYAML added in v1.18.0

func (m *ErrorMode) UnmarshalYAML(node *yaml.Node) error

type Params

type Params struct {
	ValueSource `yaml:",inline"`
	Entrypoint  string  `yaml:"entrypoint"`
	Args        any     `yaml:"args,omitempty"`
	Patch       []Patch `yaml:"patch,omitempty"`
}

func (Params) Validate

func (p Params) Validate(ctx compose.Context) error

type Patch

type Patch struct {
	Type      string  `yaml:"type"`
	Key       *string `yaml:"key,omitempty"`
	Path      *string `yaml:"path,omitempty"`
	Value     *string `yaml:"value"`
	Optimized bool    `yaml:"optimized"`
}

func (Patch) Validate

func (p Patch) Validate(ctx compose.Context) error

type Pipeline

type Pipeline struct {
	Name  string `yaml:"-"`
	Tasks []Task `yaml:",inline"`
}

func (Pipeline) Hash64

func (p Pipeline) Hash64() uint64

func (Pipeline) Len

func (p Pipeline) Len() int

func (Pipeline) Validate

func (p Pipeline) Validate(ctx compose.Context) error

type PipelineList

type PipelineList []Pipeline

func (PipelineList) MarshalYAML

func (l PipelineList) MarshalYAML() (any, error)

func (*PipelineList) UnmarshalYAML

func (l *PipelineList) UnmarshalYAML(node *yaml.Node) error

type Script

type Script struct {
	ValueSource `yaml:",inline"`
	Code        *Code    `yaml:"code,omitempty"`
	Storage     *Storage `yaml:"storage,omitempty"`
}

func (Script) Validate

func (s Script) Validate(ctx compose.Context) error

type Spec

type Spec struct {
	Version   string            `yaml:"version"`
	Accounts  []Account         `yaml:"accounts,omitempty"`
	Variables map[string]string `yaml:"variables,omitempty"`
	Pipelines PipelineList      `yaml:"pipelines"`
}

func (Spec) Validate

func (s Spec) Validate(ctx compose.Context) error

type Storage

type Storage struct {
	ValueSource `yaml:",inline"`
	Args        any     `yaml:"args,omitempty"`
	Patch       []Patch `yaml:"patch,omitempty"`
}

type Task

type Task struct {
	Type        string         `yaml:"task"`
	Alias       string         `yaml:"alias,omitempty"`
	Skip        bool           `yaml:"skip,omitempty"`
	Amount      uint64         `yaml:"amount,omitempty"`
	Script      *Script        `yaml:"script,omitempty"` // deploy only
	Params      *Params        `yaml:"params,omitempty"` // call only
	Source      string         `yaml:"source,omitempty"`
	Destination string         `yaml:"destination,omitempty"`
	Args        map[string]any `yaml:"args,omitempty"`     // token_* only
	Contents    []Task         `yaml:"contents,omitempty"` // batch only
	WaitMode    WaitMode       `yaml:"for,omitempty"`      // wait only
	Value       string         `yaml:"value,omitempty"`    // wait only
	Log         string         `yaml:"log,omitempty"`      // log level override
	OnError     ErrorMode      `yaml:"on_error,omitempty"` // how to handle errors: fail|warn|ignore
}

func (Task) Validate

func (t Task) Validate(ctx compose.Context) error

type TaskBuilder

type TaskBuilder interface {
	Type() string
	Validate(compose.Context, Task) error
	Build(compose.Context, Task) (*codec.Op, *rpc.CallOptions, error)
}

func NewTask

func NewTask(typ string) (TaskBuilder, error)

type TaskFactory

type TaskFactory func() TaskBuilder

type ValueSource

type ValueSource struct {
	File  string `yaml:"file,omitempty"`
	Url   string `yaml:"url,omitempty"`
	Value string `yaml:"value,omitempty"`
}

func (ValueSource) IsUsed

func (v ValueSource) IsUsed() bool

func (ValueSource) Validate

func (v ValueSource) Validate(ctx compose.Context) error

type WaitMode

type WaitMode byte
const (
	WaitModeInvalid WaitMode = iota
	WaitModeCycle
	WaitModeBlock
	WaitModeTime
)

func (*WaitMode) UnmarshalText

func (m *WaitMode) UnmarshalText(buf []byte) error

func (*WaitMode) UnmarshalYAML

func (m *WaitMode) UnmarshalYAML(node *yaml.Node) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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