proto

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPlugins

func WithPlugins(plugins ...Interface) func(*P)

func WithTOptions

func WithTOptions(opts ...TOption) func(*P)

Types

type Condition

type Condition struct{}

type Initializer

type Initializer interface {
	Init(context.Context, *Job) error
}

type Interface

type Interface interface {
	Name() string
	Plugin(context.Context, *P) any
	Step(context.Context) any
}

type Job

type Job struct {
	ID      string
	Plugins []Plugin
	Steps   []Step
}

type Message

type Message interface {
	Bytes() []byte
	Object() any
}

type P

type P struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...func(*P)) *P

func (*P) Evaluate

func (p *P) Evaluate(tmpl string, data any) ([]byte, error)

func (*P) Parse

func (p *P) Parse(ctx context.Context, q []byte) (*Workflow, error)

func (*P) Patterns

func (p *P) Patterns(ctx context.Context, obj wire.Object, opts ...TOption) (Patterns, error)

func (*P) Template

func (p *P) Template(ctx context.Context, obj wire.Object, out any, opts ...TOption) error

func (*P) With added in v0.1.2

func (p *P) With(opts ...func(*P)) *P

type Pattern

type Pattern struct {
	Key   *gojq.Query
	Match func(context.Context, any) (bool, error)
}

type Patterns

type Patterns []*Pattern

func (Patterns) Match

func (p Patterns) Match(ctx context.Context, obj any) (bool, error)

type Plugin

type Plugin struct {
	Uses string
	ID   string
	With any
}

type Publisher

type Publisher interface {
	Publish(context.Context) chan<- Message
}

type Runner

type Runner interface {
	Run(context.Context, *check.S) error
	Stop(ctx context.Context)
}

type Step

type Step struct {
	Uses  string
	ID    string
	Desc  string
	With  any
	Ready context.Context // defer + timeout + wait_for
}

type Subscriber

type Subscriber interface {
	Subscribe(context.Context) <-chan Message
}

type T

type T struct {
	Options []TOption
	Vars    *async.Map
}

func NewT

func NewT() *T

func (*T) Evaluate

func (t *T) Evaluate(tmpl string, data any) ([]byte, error)

func (*T) Match

func (t *T) Match(ctx context.Context, data string) func(context.Context, any) (bool, error)

func (*T) Parse

func (t *T) Parse(name, data string) (*template.Template, error)

func (*T) With

func (t *T) With(opts ...TOption) *T

type TOption

type TOption func(*template.Template) *template.Template

type Workflow

type Workflow struct {
	Jobs []Job
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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