Documentation ¶
Overview ¶
Package adapter provides a golang-native Martian job adapter and utilities.
A stage executable should should look something like
package main import ( "github.com/martian-lang/martian/martian/adapter" "github.com/martian-lang/martian/martian/core" ) func main() { adapter.RunStage(split, chunk, join) } func split(metadata *core.Metadata) (*core.StageDefs, error) { ... } func chunk(metadata *core.Metadata) (interface{}, error) { ... } func join(metadata *core.Metadata) (interface{}, error) { ... }
One executable handles all 3 phases. Stages which do not split may pass nil for the split and join arguments to RunStage.
Stage code should NEVER directly write to the log, errors, or assert files through the metadata object, but should instead return an error. For an assertion error, use the StageAssertion method. For logging, use util.LogInfo and friends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJobInfo ¶
Get the cached version of the JobInfo object for this job.
func RunStage ¶
Parses the command line and stage inputs, runs the appropriate given stage code, and saves the outputs. split and join may be nil if the stage does not split.
This should be the main entry point for all stage executables.
func StageAssertion ¶
Creates an error that is interpreted as an assertion.