step

package
v0.0.0-...-9fb4de0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package step holds all possible steps to create pipelines

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpStep

type HttpStep struct {
	DefaultTimeout time.Duration `json:"default_timeout"`
	DefaultMethod  string        `json:"default_method"`
}

func NewHTTP

func NewHTTP(defaultTimeout time.Duration, defaultMethod string) HttpStep

func UnmarshalHttpStep

func UnmarshalHttpStep(reader io.Reader) (HttpStep, error)

func (HttpStep) Invoke

func (h HttpStep) Invoke(reader io.Reader, writer io.Writer) error

type HttpStepInput

type HttpStepInput struct {
	Timeout time.Duration          `json:"timeout"`
	Method  string                 `json:"method"`
	URL     string                 `json:"url"`
	Body    map[string]interface{} `json:"body"`
	Header  http.Header            `json:"header"`
}

type HttpStepOutput

type HttpStepOutput struct {
	StatusCode int                    `json:"status_code"`
	Header     http.Header            `json:"header"`
	Body       map[string]interface{} `json:"body"`
}

type JsonStep

type JsonStep struct {
	Template string `json:"template"`
	// contains filtered or unexported fields
}

func NewJSON

func NewJSON(tmpl string) (step JsonStep, err error)

func UnmarshalJsonStep

func UnmarshalJsonStep(reader io.Reader) (JsonStep, error)

func (JsonStep) Invoke

func (j JsonStep) Invoke(reader io.Reader, writer io.Writer) error

type NoOpStep

type NoOpStep struct{}

NoOpStep is a step that does nothing but copy from the reader to the writer. It's good e.g. for testing purposes where you simply want to check the functionality of the pipeline itself.

func (NoOpStep) Invoke

func (n NoOpStep) Invoke(reader io.Reader, writer io.Writer) error

Jump to

Keyboard shortcuts

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