executor

package
v0.0.0-...-f1bdcb5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(e *Executor, name string, args []interface{}) (step.Function, error)

Get will return a result of any public method from Executor. Method will be found by its name, example: string `get name` will call method `GetName`. All necessary arguments will be taken from the args variable and placed innumerable: `GetName(args[0], args[1], ...)`

Types

type AppConsulArgs

type AppConsulArgs struct {
	// region Request
	Config *ConfigAppConsulArgs `json:"config"`
	// endregion
	// region Require
	Require AppConsulArgsRequire `json:"require"`
}

func (*AppConsulArgs) Validate

func (a *AppConsulArgs) Validate() (err error)

type AppRedisArgs

type AppRedisArgs struct {
	URL      string               `json:"url"`
	Password string               `json:"password"`
	Cmd      string               `json:"cmd"`
	Args     []interface{}        `json:"args"`
	Require  *AppRedisArgsRequire `json:"require"`
}

func (*AppRedisArgs) Validate

func (a *AppRedisArgs) Validate() (err error)

type CmdArgs

type CmdArgs struct {
	Command []string          `json:"command"`
	Dir     string            `json:"dir"`
	Env     map[string]string `json:"env"`
	Input   *ReachText        `json:"input"`
	Timeout Duration          `json:"timeout"`
	Require CmdArgsRequire    `json:"require"`
}

func (*CmdArgs) Validate

func (a *CmdArgs) Validate() (err error)

type ConfigAppConsulArgs

type ConfigAppConsulArgs struct {
	Address    string                       `json:"address"`
	Scheme     string                       `json:"scheme"`
	Datacenter string                       `json:"datacenter"`
	HttpAuth   *HttpAuthConfigAppConsulArgs `json:"http_auth"`
	WaitTime   time.Duration                `json:"wait_time"`
	Token      string                       `json:"token"`
	TokenFile  string                       `json:"token_file"`
	Namespace  string                       `json:"namespace"`
	TLSConfig  TLSConfigConfigAppConsulArgs `json:"tls_config"`
}

type DialArgs

type DialArgs struct {
	// region Request
	Type    String     `json:"type"`
	Address String     `json:"address"`
	Input   *ReachText `json:"input"`
	Until   string     `json:"until"`
	Timeout Duration   `json:"timeout"`
	// endregion
	// region Require
	Require *DialArgsRequire `json:"require"`
}

func (*DialArgs) Validate

func (a *DialArgs) Validate() (err error)

type Executor

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

func NewExecutor

func NewExecutor(ctx context.Context, version string) *Executor

func (*Executor) AppConsul

func (e *Executor) AppConsul(args *AppConsulArgs) (step.Function, error)

func (*Executor) AppRedis

func (e *Executor) AppRedis(args *AppRedisArgs) (step.Function, error)

func (*Executor) Close

func (e *Executor) Close() error

Close is an io.Closer function

func (*Executor) Cmd

func (e *Executor) Cmd(args *CmdArgs) (step.Function, error)

func (*Executor) Dial

func (e *Executor) Dial(args *DialArgs) (step.Function, error)

func (*Executor) Http

func (e *Executor) Http(args *HttpArgs) (step.Function, error)

func (*Executor) Repeat

func (e *Executor) Repeat(args *RepeatArgs, cmd *config.Step) (step.Function, error)

func (*Executor) Simple

func (e *Executor) Simple(args *SimpleArgs) (step.Function, error)

Simple will just return value from args

func (*Executor) Sql

func (e *Executor) Sql(args *SqlArgs) (step.Function, error)

type HttpArgs

type HttpArgs struct {
	// region Request
	Method    string             `json:"method"`
	Url       string             `json:"url"`
	Payload   *ReachText         `json:"payload"`
	Form      HttpArgsForm       `json:"form"`
	Headers   map[string]string  `json:"headers"`
	Timeout   Duration           `json:"timeout"`
	Redirect  bool               `json:"redirect"`
	BasicAuth *HttpArgsBasicAuth `json:"basic_auth"`
	// endregion
	// region Response
	Require HttArgsRequire `json:"require"`
}

func (*HttpArgs) Validate

func (a *HttpArgs) Validate() (err error)

type HttpAuthConfigAppConsulArgs

type HttpAuthConfigAppConsulArgs struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type RepeatArgs

type RepeatArgs struct {
	Count   int               `json:"count"`
	Delay   Duration          `json:"delay"`
	Require RepeatArgsRequire `json:"require"`
}

func (*RepeatArgs) Validate

func (a *RepeatArgs) Validate() (err error)

type SimpleArgs

type SimpleArgs struct {
	Sleep   Duration    `json:"sleep"`
	Status  step.Status `json:"status"`
	Message string      `json:"message"`
}

func (*SimpleArgs) Validate

func (a *SimpleArgs) Validate() (err error)

Validate is a wrapper to Validate all internal attributes

type SqlArgs

type SqlArgs struct {
	Driver  string         `json:"driver"`
	URL     string         `json:"url"`
	SQL     string         `json:"sql"`
	Args    []interface{}  `json:"args"`
	Require SqlArgsRequire `json:"require"`
}

func (*SqlArgs) Validate

func (a *SqlArgs) Validate() (err error)

type TLSConfigConfigAppConsulArgs

type TLSConfigConfigAppConsulArgs struct {
	Address            string `json:"address"`
	CAFile             string `json:"ca_file"`
	CAPath             string `json:"ca_path"`
	CAPem              []byte `json:"ca_pem"`
	CertFile           string `json:"cert_file"`
	CertPEM            []byte `json:"cert_pem"`
	KeyFile            string `json:"key_file"`
	KeyPEM             []byte `json:"key_pem"`
	InsecureSkipVerify bool   `json:"insecure_skip_verify"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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