types

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildResult

type ChildResult struct {
	Code   int // exit code
	Stdout []byte
	Stderr []byte
}

ChildResult is the result of process

type Context

type Context struct {
	Command string
	Args    []string
	Meta    map[string]interface{}
}

Context is the context passed as part of Lifecycle events

type Event

type Event struct {
	Type      EventType              `json:"type"`
	Timestamp int64                  `json:"timestamp"`
	Meta      map[string]interface{} `json:"meta"`
	Data      interface{}            `json:"data"`
}

Event is a single event in a given lifecycle. Meta is the user passed in metadata. The type of data will be dependent on the event type.

type EventType

type EventType string

EventType is a type of event representing a stage in the lifecycle

const (
	EventTypeBegin     EventType = "begin"
	EventTypeProgress  EventType = "progress"
	EventTypeCompleted EventType = "completed"
	EventTypeFailed    EventType = "failed"
	EventTypeCanceled  EventType = "canceled"
)

type HandlerConfig

type HandlerConfig struct {
	// Type of handler
	Type string
	// Any uri
	URI string
	// Transform applied before calling the handler
	Transform TransformConfig
	// List of keys to set the context from handler responses
	Context []string
	// Body of the handler
	Body string
	// Handler specific configs
	Options Options
	// Continue running child process even it handler returns error
	IgnoreErrors bool `yaml:"ignorerrors"`
}

HandlerConfig holds the config for a given handler

func (*HandlerConfig) Clone

func (conf *HandlerConfig) Clone() *HandlerConfig

Clone clones an existing config

type Options

type Options map[string]interface{}

func (Options) GetString

func (opt Options) GetString(key string) (string, bool)

type TransformConfig

type TransformConfig []string

TransformConfig holds configs for a transform

func (TransformConfig) ValidateTransform added in v0.1.4

func (conf TransformConfig) ValidateTransform() (bool, error)

ValidateTransform validates the transform

Jump to

Keyboard shortcuts

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