promise

package
v0.0.0-...-5c92d4a Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2015 License: GPL-3.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ArgumentCount = SetvarError("(setvar) needs 2 arguments")
)

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 (argGetter ArgGetter) GetValue(arguments []Constant, vars *Variables) string

func (ArgGetter) String

func (argGetter ArgGetter) String() string

type Argument

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

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 {
	Logger     *Logger
	ExecOutput *bytes.Buffer
	Vars       Variables
	Args       []string
	Env        []string
	InDir      string
	Debug      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) String

func (envGetter EnvGetter) String() string

type ExecPromise

type ExecPromise struct {
	Type      ExecType
	Arguments []Argument
}

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(logger *Logger)

func (ExecType) Name

func (t ExecType) Name() string

func (ExecType) String

func (t ExecType) String() string

type InDir

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

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 Logger

type Logger struct {
	Info    *log.Logger
	Error   *log.Logger
	Changes int
	Tests   int
}

func NewLogger

func NewLogger() *Logger

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 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 ReadvarWriter

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

func (*ReadvarWriter) Write

func (w *ReadvarWriter) Write(p []byte) (n int, err error)

type RestartPromise

type RestartPromise struct {
	NewExe 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 SetEnv

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

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 SetvarError

type SetvarError string

func (SetvarError) Error

func (e SetvarError) Error() string

type SetvarPromise

type SetvarPromise struct {
	VarName  Argument
	VarValue 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 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