promise

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

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

Go to latest
Published: Feb 26, 2017 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndPromise

type AndPromise struct {
	Promises []Promise
}

func (AndPromise) Desc

func (p AndPromise) Desc(arguments []Constant) string

func (AndPromise) Eval

func (p AndPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (AndPromise) New

func (p AndPromise) New(children []Promise, args []Argument) (Promise, error)

type ArgGetter

type ArgGetter struct {
	Position int
}

func (ArgGetter) GetValue

func (p ArgGetter) GetValue(arguments []Constant, vars *Variables) string

func (ArgGetter) Marshal

func (p ArgGetter) Marshal(writer io.Writer) error

func (ArgGetter) String

func (p ArgGetter) String() string

type Argument

type Argument interface {
	GetValue(arguments []Constant, vars *Variables) string
	String() string
}

type AsUser

type AsUser struct {
	UserName Argument
	Promise  Promise
}

func (AsUser) Desc

func (p AsUser) Desc(arguments []Constant) string

func (AsUser) Eval

func (p AsUser) Eval(arguments []Constant, ctx *Context, stack string) bool

func (AsUser) New

func (p AsUser) New(children []Promise, args []Argument) (Promise, error)

type Constant

type Constant string

func (Constant) GetValue

func (constant Constant) GetValue(arguments []Constant, vars *Variables) string

func (Constant) String

func (constant Constant) String() string

type Context

type Context struct {
	Compile    compileFunc
	ExecStdout *bytes.Buffer
	ExecStderr *bytes.Buffer
	Credential *syscall.Credential
	Vars       Variables
	Args       []string
	Env        []string
	InDir      string
	Verbose    bool
}

func NewContext

func NewContext() Context

type EnvGetter

type EnvGetter struct {
	Name string
}

func (EnvGetter) GetValue

func (envGetter EnvGetter) GetValue(arguments []Constant, vars *Variables) string

func (EnvGetter) Marshal

func (p EnvGetter) Marshal(writer io.Writer) error

func (EnvGetter) String

func (envGetter EnvGetter) String() string

type EvalPromise

type EvalPromise struct {
	RootPromise Argument
	InputPath   Argument
}

////////////////////////////////////////////////////////////////////////////////

func (EvalPromise) Desc

func (p EvalPromise) Desc(arguments []Constant) string

////////////////////////////////////////////////////////////////////////////////

func (EvalPromise) Eval

func (p EvalPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

////////////////////////////////////////////////////////////////////////////////

func (EvalPromise) New

func (p EvalPromise) New(children []Promise, args []Argument) (Promise, error)

////////////////////////////////////////////////////////////////////////////////

type ExecPromise

type ExecPromise struct {
	Type      ExecType
	Arguments []Argument
	// contains filtered or unexported fields
}

func (ExecPromise) Desc

func (p ExecPromise) Desc(arguments []Constant) string

func (ExecPromise) Eval

func (p ExecPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (ExecPromise) New

func (p ExecPromise) New(children []Promise, args []Argument) (Promise, error)

type ExecType

type ExecType int
const (
	ExecChange ExecType = iota
	ExecTest
)

func (ExecType) IncrementExecCounter

func (t ExecType) IncrementExecCounter()

func (ExecType) Name

func (t ExecType) Name() string

func (ExecType) String

func (t ExecType) String() string

type FalsePromise

type FalsePromise struct {
	Promise Promise
}

func (FalsePromise) Desc

func (p FalsePromise) Desc(arguments []Constant) string

func (FalsePromise) Eval

func (p FalsePromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (FalsePromise) New

func (p FalsePromise) New(children []Promise, args []Argument) (Promise, error)

type InDir

type InDir struct {
	Dir     Argument
	Promise Promise
}

//////////////////////////////////////////////////////////////////////////////

func (InDir) Desc

func (p InDir) Desc(arguments []Constant) string

//////////////////////////////////////////////////////////////////////////////

func (InDir) Eval

func (p InDir) Eval(arguments []Constant, ctx *Context, stack string) bool

//////////////////////////////////////////////////////////////////////////////

func (InDir) New

func (p InDir) New(children []Promise, args []Argument) (Promise, error)

//////////////////////////////////////////////////////////////////////////////

type JoinArgument

type JoinArgument struct {
	Args []Argument
}

func (JoinArgument) GetValue

func (this JoinArgument) GetValue(arguments []Constant, vars *Variables) string

func (JoinArgument) String

func (this JoinArgument) String() string

type LogPromise

type LogPromise struct {
	Args []Argument
	Type LogType
}

func (LogPromise) Desc

func (p LogPromise) Desc(arguments []Constant) string

func (LogPromise) Eval

func (p LogPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (LogPromise) New

func (p LogPromise) New(children []Promise, args []Argument) (Promise, error)

type LogType

type LogType int
const (
	LogTypeInfo LogType = iota
	LogTypeWarning
	LogTypeError
)

type NamedPromise

type NamedPromise struct {
	Name      string
	Promise   Promise
	Arguments []Argument
}

func (NamedPromise) Desc

func (p NamedPromise) Desc(arguments []Constant) string

func (NamedPromise) Eval

func (p NamedPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (NamedPromise) New

func (p NamedPromise) New(children []Promise, args []Argument) (Promise, error)

func (NamedPromise) String

func (p NamedPromise) String() string

type NewNotSupported

type NewNotSupported string

func (NewNotSupported) Error

func (e NewNotSupported) Error() string

type NotPromise

type NotPromise struct {
	Promise Promise
}

func (NotPromise) Desc

func (p NotPromise) Desc(arguments []Constant) string

func (NotPromise) Eval

func (p NotPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (NotPromise) New

func (p NotPromise) New(children []Promise, args []Argument) (Promise, error)

type OrPromise

type OrPromise struct {
	Promises []Promise
}

func (OrPromise) Desc

func (p OrPromise) Desc(arguments []Constant) string

func (OrPromise) Eval

func (p OrPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (OrPromise) New

func (p OrPromise) New(children []Promise, args []Argument) (Promise, error)

type PipePromise

type PipePromise struct {
	Execs []ExecPromise
}

func (PipePromise) Desc

func (p PipePromise) Desc(arguments []Constant) string

func (PipePromise) Eval

func (p PipePromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (PipePromise) New

func (p PipePromise) New(children []Promise, args []Argument) (Promise, error)

type Promise

type Promise interface {
	Desc(arguments []Constant) string
	Eval(arguments []Constant, ctx *Context, stack string) bool
	New(children []Promise, args []Argument) (Promise, error)
}

type ReadvarPromise

type ReadvarPromise struct {
	VarName Argument
	Exec    Promise
}

func (ReadvarPromise) Desc

func (p ReadvarPromise) Desc(arguments []Constant) string

func (ReadvarPromise) Eval

func (p ReadvarPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (ReadvarPromise) New

func (p ReadvarPromise) New(children []Promise, args []Argument) (Promise, error)

type RestartPromise

type RestartPromise struct {
	Args []Argument
}

func (RestartPromise) Desc

func (p RestartPromise) Desc(arguments []Constant) string

func (RestartPromise) Eval

func (p RestartPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (RestartPromise) New

func (p RestartPromise) New(children []Promise, args []Argument) (Promise, error)

type SPipePromise

type SPipePromise struct {
	Execs []ExecPromise
}

func (SPipePromise) Desc

func (p SPipePromise) Desc(arguments []Constant) string

func (SPipePromise) Eval

func (p SPipePromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (SPipePromise) New

func (p SPipePromise) New(children []Promise, args []Argument) (Promise, error)

type SetEnv

type SetEnv struct {
	Name  Argument
	Value Argument
	Child Promise
}

func (SetEnv) Desc

func (s SetEnv) Desc(arguments []Constant) string

func (SetEnv) Eval

func (s SetEnv) Eval(arguments []Constant, ctx *Context, stack string) bool

func (SetEnv) New

func (s SetEnv) New(children []Promise, args []Argument) (Promise, error)

type SetvarPromise

type SetvarPromise struct {
	Name  Argument
	Value Argument
}

func (SetvarPromise) Desc

func (p SetvarPromise) Desc(arguments []Constant) string

func (SetvarPromise) Eval

func (p SetvarPromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (SetvarPromise) New

func (p SetvarPromise) New(children []Promise, args []Argument) (Promise, error)

type TemplatePromise

type TemplatePromise struct {
	JsonInput    Argument
	TemplateFile Argument
	Output       Argument
}

func (TemplatePromise) Desc

func (t TemplatePromise) Desc(arguments []Constant) string

func (TemplatePromise) Eval

func (t TemplatePromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (TemplatePromise) New

func (t TemplatePromise) New(children []Promise, args []Argument) (Promise, error)

type TruePromise

type TruePromise struct {
	Promise Promise
}

func (TruePromise) Desc

func (p TruePromise) Desc(arguments []Constant) string

func (TruePromise) Eval

func (p TruePromise) Eval(arguments []Constant, ctx *Context, stack string) bool

func (TruePromise) New

func (p TruePromise) New(children []Promise, args []Argument) (Promise, error)

type VarGetter

type VarGetter struct {
	Name string
}

func (VarGetter) GetValue

func (getter VarGetter) GetValue(arguments []Constant, vars *Variables) string

func (VarGetter) String

func (getter VarGetter) String() string

type Variables

type Variables map[string]string

Jump to

Keyboard shortcuts

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