Documentation ¶
Overview ¶
Package for building an execution pipeline and executing it.
Index ¶
- type Pipeline
- func (p *Pipeline) AddStage(s Stage)
- func (p *Pipeline) ExecuteStage(stage *Stage) (string, error)
- func (p *Pipeline) GetResult(format string) string
- func (p *Pipeline) Print()
- func (p *Pipeline) Results(resultType string) ([]byte, error)
- func (p *Pipeline) Run() ([]*Result, error)
- func (p *Pipeline) RunSequential() ([]*Result, error)
- func (p *Pipeline) Save() error
- type Result
- type Stage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pipeline ¶
type Pipeline struct { Name string "name,omitempty" RServer *r.Server "r-server,omitempty" Stages []*Stage "stages,omitempty" }
The pipeline. A name, reference to an opencpu server and list of pipeline stages.
func ImportPipeline ¶
func NewPipeline ¶
Set up new pipeline with the given name and reference to gopencpu server
func (*Pipeline) ExecuteStage ¶
Executes a pipeline stage.
func (*Pipeline) Run ¶
Exectues a pipeline. Uses a go routine per pipeline stage making it possible to execute multiple stages simultaneously. Returns a list of results, one per stage.
func (*Pipeline) RunSequential ¶
type Result ¶
For storing the result of a pipeline stage. Key can be used to retrieve plots/results later using the gopencpu package.
type Stage ¶
type Stage struct { Name string "name,omitempty" Package string "package,omitempty" Function string "function,omitempty" Arguments map[string]string "arguments,omitempty" Depends []string "depends,omitempty" Session string "session,omitempty" Output string "output,omitempty" }
A pipeline stage. Name: A unique name for each stage. Function: Function name, e.g. plot. Package: Which statistical package the function comes from, e.g. graphics for plot(). Arguments: A name:value map for arguments to the function. Depends: List of stages it depends on. Session: Reference to the OpenCPU session used to compute the results from this stage. Output: String for storing output from pipeline stage execution.
func NewStage ¶
Creates a new pipeline stage. Argnames is an array of argument names, args are the values for each of the arguments. Assumes that argnames and args are of the same length.
func (*Stage) GetArguments ¶
Create a string of arguments for usage by the Call method in the gopencpu package
func (Stage) GetDependencies ¶
Returns all dependencies for a stage.
func (*Stage) ReplaceArg ¶
Replace any "from:stage-name" argument values into opencpu references