fulfillment

package
v0.0.0-...-d2d06f5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fulfiller

type Fulfiller interface {
	Execute(ctx context.Context, rs results.Results) <-chan results.Result
	Name() string
}

Fulfiller executes and return results

func NewNoop

func NewNoop(f map[string]interface{}, name string, a actions.Action, cs transcons.Conditions) (Fulfiller, error)

NewNoop initializes noop fulfiller

func NewPoller

func NewPoller(f map[string]interface{}, name string, a actions.Action, cs transcons.Conditions) (Fulfiller, error)

NewPoller parses, initializes and returns a configured poller

type NoopFulfillment

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

NoopFulfillment stores actions and conditions

func (NoopFulfillment) Execute

func (n NoopFulfillment) Execute(ctx context.Context, rs results.Results) <-chan results.Result

Execute calls an action and sends its result

func (NoopFulfillment) Name

func (n NoopFulfillment) Name() string

Name is a string identifier for this fulfiller

type Poller

type Poller struct {
	Interval time.Duration
	Timeout  time.Duration
	// contains filtered or unexported fields
}

Poller contains actions and conditions, and polling configuration

func (Poller) Execute

func (p Poller) Execute(ctx context.Context, rs results.Results) <-chan results.Result

Execute Naively has a timeout, needs context, interval can execute longer than timeout

func (Poller) Name

func (p Poller) Name() string

Name identifies this poller

type Registry

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

Registry contains fulfiller string identifiers mapped to loader functions

func NewRegistry

func NewRegistry() (Registry, error)

NewRegistry creates a usable registry

func (Registry) Load

func (r Registry) Load(f map[string]interface{}, name string, a actions.Action, cs transcons.Conditions) (Fulfiller, error)

Load parses a generic map into a fulfiller

Jump to

Keyboard shortcuts

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