Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorCatalogInvalid(path string, reason string) error
- func ErrorCatalogItemAlreadyExists(path string, itemName ItemLabel) error
- func ErrorCatalogName(name string, reason string) error
- func ErrorCatalogParse(path string, cause error) error
- func ErrorDataTooNew(context string, cause error) error
- func ErrorExecutorFailed(executorEngineName string, cause error) error
- func ErrorFileAlreadyExists(path string) error
- func ErrorFileMissing(path string) error
- func ErrorFormulaExecutionFailed(cause error) error
- func ErrorFormulaInvalid(reason string) error
- func ErrorGeneratorFailed(generatorName string, inputFile string, details string) error
- func ErrorGit(context string, cause error) error
- func ErrorIo(context string, path string, cause error) error
- func ErrorMissingCatalogEntry(ref CatalogRef, replayAvailable bool) error
- func ErrorModuleInvalid(reason string) error
- func ErrorPlotExecutionFailed(cause error) error
- func ErrorPlotInvalid(reason string) error
- func ErrorPlotStepFailed(stepName StepName, cause error) error
- func ErrorSearchingFilesystem(searchingFor string, cause error) error
- func ErrorSerialization(context string, cause error) error
- func ErrorSyscall(fmtPattern string, args ...interface{}) error
- func ErrorWareIdInvalid(wareId WareID) error
- func ErrorWarePack(path string, cause error) error
- func ErrorWareUnpack(wareId WareID, cause error) error
- func ErrorWorkspace(wsPath string, cause error) error
- func IsCode(err error, code string) bool
- func TerminalError(err serum.ErrorInterface, exitCode int)
- type Action
- type Action_Echo
- type Action_Exec
- type Action_Script
- type ApiOutput
- type Catalog
- type CatalogLineage
- type CatalogMirrors
- type CatalogMirrorsByModule
- type CatalogMirrorsByPacktype
- type CatalogMirrorsByWare
- type CatalogMirrorsCapsule
- type CatalogModule
- type CatalogModuleCapsule
- type CatalogRef
- type CatalogRelease
- type CatalogReleaseCID
- type FilterMap
- type Formula
- type FormulaAndContext
- type FormulaCapsule
- type FormulaContext
- type FormulaContextCapsule
- type FormulaExecConfig
- type FormulaInput
- type FormulaInputComplex
- type FormulaInputSimple
- type GatherDirective
- type GitIngest
- type Ingest
- type ItemLabel
- type Literal
- type LocalLabel
- type LogOutput
- type Module
- type ModuleCapsule
- type ModuleName
- type Mount
- type MountMode
- type OutputName
- type Packtype
- type Pipe
- type Plot
- type PlotCID
- type PlotCapsule
- type PlotExecConfig
- type PlotInput
- type PlotInputComplex
- type PlotInputSimple
- type PlotOutput
- type PlotResults
- type Protoformula
- type ReleaseName
- type ReplayCapsule
- type RunRecord
- type SandboxPath
- type SandboxPort
- type SandboxVar
- type Step
- type StepName
- type WareID
- type WarehouseAddr
Constants ¶
const ( // ECodeArgument may be used when invalid arguments are provided to the warpforge command line ECodeArgument = "warpforge-error-invalid-argument" // ECodeAlreadyExists may be used when _something_ already exists. // Prefer to use a more specific error code or specify _what_ is missing. ECodeAlreadyExists = "warpforge-error-already-exists" ECodeCatalogInvalid = "warpforge-error-catalog-invalid" ECodeCatalogMissingEntry = "warpforge-error-catalog-missing-entry" ECodeCatalogName = "warpforge-error-catalog-name" ECodeCatalogParse = "warpforge-error-catalog-parse" ECodeDataTooNew = "warpforge-error-datatoonew" ECodeExecutorFailed = "warpforge-error-executor-failed" ECodeFormulaExecutionFailed = "warpforge-error-formula-execution-failed" ECodeFormulaInvalid = "warpforge-error-formula-invalid" ECodeGeneratorFailed = "warpforge-error-generator-failed" ECodeGit = "warpforge-error-git" // ECodeInternal is used for errors that are internal and cannot be handled by users. // Try to pick something more specific. ECodeInternal = "warpforge-error-internal" // ECodeInvalid is used when something is invalid. // Prefer to choose a more specific error code. ECodeInvalid = "warpforge-error-invalid" ECodeIo = "warpforge-error-io" ECodeMissing = "warpforge-error-missing" ECodeModuleInvalid = "warpforge-error-module-invalid" ECodePlotExecution = "warpforge-error-plot-execution-failed" ECodePlotInvalid = "warpforge-error-plot-invalid" ECodePlotStepFailed = "warpforge-error-plot-step-failed" ECodeSearchingFilesystem = "warpforge-error-searching-filesystem" ECodeSerialization = "warpforge-error-serialization" ECodeSyscall = "warpforge-error-syscall" // ECodeUnknown is used for unknown errors. Avoid whenever possible. ECodeUnknown = "warpforge-error-unknown" ECodeWareIdInvalid = "warpforge-error-wareid-invalid" ECodeWarePack = "warpforge-error-ware-pack" ECodeWareUnpack = "warpforge-error-ware-unpack" ECodeWorkspace = "warpforge-error-workspace" )
TODO: Add comments for reasons to use or not use particular codes
Variables ¶
var LinkSystem = cidlink.DefaultLinkSystem()
var TypeSystem = func() *schema.TypeSystem { schReader, err := schFs.Open("wfapi.ipldsch") if err != nil { panic(fmt.Sprintf("failed to open embedded wfapi.ipldsch: %s", err)) } ts, err := ipld.LoadSchema("warpforge", schReader) if err != nil { panic(fmt.Sprintf("failed to parse api schema: %s", err)) } return ts }()
Functions ¶
func ErrorCatalogInvalid ¶
ErrorCatalogInvalid is returned when a catalog contains invalid data
Errors:
- warpforge-error-catalog-invalid --
func ErrorCatalogItemAlreadyExists ¶
ErrorCatalogItemAlreadyExists is returned when trying to add an item that already exists
Errors:
- warpforge-error-already-exists --
func ErrorCatalogName ¶
ErrorCatalogName is returned when a catalog name is invalid
Errors:
- warpforge-error-catalog-name --
func ErrorCatalogParse ¶
ErrorCatalogParse is returned when parsing of a catalog file fails
Errors:
- warpforge-error-catalog-parse --
func ErrorDataTooNew ¶
ErrorDataTooNew is returned when some data was (partially) deserialized, but only enough that we could recognize it as being a newer version of message than this application supports.
Errors:
- warpforge-error-datatoonew -- if some data is too new to parse completely.
func ErrorExecutorFailed ¶
ErrorExecutorFailed is returned when a container executor (e.g., runc) returns an error.
Errors:
- warpforge-error-executor-failed --
func ErrorFileAlreadyExists ¶
ErrorFileAlreadyExists is used when a file already exists
Errors:
- warpforge-error-already-exists --
func ErrorFileMissing ¶
ErrorFileMissing is used when an expected file does not exist
Errors:
- warpforge-error-missing --
func ErrorFormulaExecutionFailed ¶
ErrorFormulaExecutionFailed is returned to wrap generic errors that cause formula execution to fail.
Errors:
- warpforge-error-formula-execution-failed --
func ErrorFormulaInvalid ¶
ErrorFormulaInvalid is returned when a formula contains invalid data
Errors:
- warpforge-error-formula-invalid --
func ErrorGeneratorFailed ¶
ErrorGeneratorFailed is returned when an external generator fails
Errors:
- warpforge-error-generator-failed --
func ErrorMissingCatalogEntry ¶
func ErrorMissingCatalogEntry(ref CatalogRef, replayAvailable bool) error
ErrorMissingCatalogEntry is returned when a catalog entry cannot be found
Errors:
- warpforge-error-catalog-missing-entry --
func ErrorModuleInvalid ¶
ErrorModuleInvalid is returned when a module contains invalid data
Errors:
- warpforge-error-module-invalid --
func ErrorPlotExecutionFailed ¶
ErrorPlotExecutionFailed is used to wrap errors around plot execution Errors:
- warpforge-error-plot-execution-failed --
func ErrorPlotInvalid ¶
ErrorPlotInvalid is returned when a plot contains invalid data
Errors:
- warpforge-error-plot-invalid --
func ErrorPlotStepFailed ¶
ErrorPlotStepFailed is returned execution of a Step within a Plot fails
Errors:
- warpforge-error-plot-step-failed --
func ErrorSearchingFilesystem ¶
ErrorSearchingFilesystem is returned when an error occurs during search
Errors:
- warpforge-error-searching-filesystem --
func ErrorSerialization ¶
ErrorSerialization is returned when a serialization or deserialization error occurs
Errors:
- warpforge-error-serialization --
func ErrorSyscall ¶
ErrorSyscall is used to wrap errors from the syscall package
Errors:
- warpforge-error-syscall --
func ErrorWareIdInvalid ¶
ErrorWareIdInvalid is returned when a malformed WareID is parsed
Errors:
- warpforge-error-wareid-invalid --
func ErrorWarePack ¶
ErrorWarePack is returned when the packing of a ware fails
Errors:
- warpforge-error-ware-pack --
func ErrorWareUnpack ¶
ErrorWareUnpack is returned when the unpacking of a ware fails
Errors:
- warpforge-error-ware-unpack --
func ErrorWorkspace ¶
ErrorWorkspace is returned when an error occurs when handling a workspace
Errors:
- warpforge-error-workspace --
func IsCode ¶
IsCode reports whether any error in err's chain matches the given code string.
The chain consists of err itself followed by the sequence of errors obtained by repeatedly calling serum.Cause which is similar to calling Unwrap.
An error is considered to match the code string if the result of serum.Code(err) is equal to the code string.
func TerminalError ¶
func TerminalError(err serum.ErrorInterface, exitCode int)
TerminalError emits an error on stdout as json, and halts immediately. In most cases, you should not use this method, and there will be a better place to send errors that will be more guaranteed to fit any protocols and scripts better; however, this is sometimes used in init methods (where we know no other protocol yet).
Types ¶
type Action ¶
type Action struct { Echo *Action_Echo Exec *Action_Exec Script *Action_Script }
Action is a union (aka sum type). Exactly one of its fields will be set.
type Action_Echo ¶
type Action_Echo struct { }
type Action_Exec ¶
type Action_Script ¶
type ApiOutput ¶
type ApiOutput struct { Output *string Log *LogOutput RunRecord *RunRecord PlotResults *PlotResults }
type Catalog ¶
type Catalog struct { Keys []ModuleName Values map[ModuleName]CatalogModule }
type CatalogLineage ¶
type CatalogLineage struct { Name string Metadata struct { Keys []string Values map[string]string } Releases []CatalogRelease }
type CatalogMirrors ¶
type CatalogMirrors struct { ByWare *CatalogMirrorsByWare ByModule *CatalogMirrorsByModule }
type CatalogMirrorsByModule ¶
type CatalogMirrorsByModule struct { Keys []ModuleName Values map[ModuleName]CatalogMirrorsByPacktype }
type CatalogMirrorsByPacktype ¶
type CatalogMirrorsByPacktype struct { Keys []Packtype Values map[Packtype][]WarehouseAddr }
type CatalogMirrorsByWare ¶
type CatalogMirrorsByWare struct { Keys []WareID Values map[WareID][]WarehouseAddr }
type CatalogMirrorsCapsule ¶
type CatalogMirrorsCapsule struct {
CatalogMirrors *CatalogMirrors
}
type CatalogModule ¶
type CatalogModule struct { Name ModuleName Releases struct { Keys []ReleaseName Values map[ReleaseName]CatalogReleaseCID } Metadata struct { Keys []string Values map[string]string } }
type CatalogModuleCapsule ¶
type CatalogModuleCapsule struct {
CatalogModule *CatalogModule
}
type CatalogRef ¶
type CatalogRef struct { ModuleName ModuleName ReleaseName ReleaseName ItemName ItemLabel }
func (*CatalogRef) String ¶
func (c *CatalogRef) String() string
type CatalogRelease ¶
type CatalogRelease struct { ReleaseName ReleaseName Items struct { Keys []ItemLabel Values map[ItemLabel]WareID } Metadata struct { Keys []string Values map[string]string } }
func (*CatalogRelease) Cid ¶
func (rel *CatalogRelease) Cid() CatalogReleaseCID
type CatalogReleaseCID ¶
type CatalogReleaseCID string
type Formula ¶
type Formula struct { Inputs struct { Keys []SandboxPort Values map[SandboxPort]FormulaInput } Action Action Outputs struct { Keys []OutputName Values map[OutputName]GatherDirective } }
type FormulaAndContext ¶
type FormulaAndContext struct { Formula FormulaCapsule Context *FormulaContextCapsule }
type FormulaCapsule ¶
type FormulaCapsule struct {
Formula *Formula
}
type FormulaContext ¶
type FormulaContext struct { Warehouses struct { Keys []WareID Values map[WareID]WarehouseAddr } }
type FormulaContextCapsule ¶
type FormulaContextCapsule struct {
FormulaContext *FormulaContext
}
type FormulaExecConfig ¶
type FormulaInput ¶
type FormulaInput struct { FormulaInputSimple *FormulaInputSimple FormulaInputComplex *FormulaInputComplex }
func (*FormulaInput) Basis ¶
func (fi *FormulaInput) Basis() *FormulaInputSimple
type FormulaInputComplex ¶
type FormulaInputComplex struct { Basis FormulaInputSimple Filters FilterMap }
type FormulaInputSimple ¶
type GatherDirective ¶
type GatherDirective struct { From SandboxPort Packtype *Packtype // 'optional': should be absent iff SandboxPort is a SandboxVar. Filters *FilterMap // 'optional': must be absent if SandboxPort is a SandboxVar. }
type LocalLabel ¶
type LocalLabel string
LocalLabel is for referencing data within a Plot. Input data gets assigned a LocalLabel; Pipes pull info from a LocalLabel (possibly together with a StepName to scope it); when a Step is evaluated (e.g. turned into a Formula, executed, and produces results), the results will become identifiable by a LocalLabel (scoped by the StepName).
(LocalLabel and OutputName are essentially the same thing: an OutputName gets casted to being considered a LocalLabel when a Formula's results are hoisted into the Plot.)
Must not contain ':' charaters or unprintables or whitespace.
type Module ¶
type Module struct { // name might go here? other config? unsure honestly, mostly leaving space for future expansion. Name ModuleName }
type ModuleCapsule ¶
type ModuleCapsule struct {
Module *Module
}
type ModuleName ¶
type ModuleName string
type OutputName ¶
type OutputName string
type Pipe ¶
type Pipe struct { StepName StepName Label LocalLabel }
type Plot ¶
type Plot struct { Inputs struct { Keys []LocalLabel Values map[LocalLabel]PlotInput } Steps struct { Keys []StepName Values map[StepName]Step } Outputs struct { Keys []LocalLabel Values map[LocalLabel]PlotOutput } }
type PlotCapsule ¶
type PlotCapsule struct {
Plot *Plot
}
type PlotExecConfig ¶
type PlotExecConfig struct { Recursive bool FormulaExecConfig FormulaExecConfig }
type PlotInput ¶
type PlotInput struct { PlotInputSimple *PlotInputSimple PlotInputComplex *PlotInputComplex }
func (*PlotInput) Basis ¶
func (pi *PlotInput) Basis() *PlotInputSimple
type PlotInputComplex ¶
type PlotInputComplex struct { Basis PlotInputSimple Filters FilterMap }
type PlotInputSimple ¶
type PlotOutput ¶
type PlotOutput struct {
Pipe *Pipe
}
type PlotResults ¶
type PlotResults struct { Keys []LocalLabel Values map[LocalLabel]WareID }
type Protoformula ¶
type Protoformula struct { Inputs struct { Keys []SandboxPort Values map[SandboxPort]PlotInput } Action Action Outputs struct { Keys []LocalLabel Values map[LocalLabel]GatherDirective } }
type ReleaseName ¶
type ReleaseName string
type ReplayCapsule ¶
type ReplayCapsule struct {
Plot *Plot
}
type RunRecord ¶
type RunRecord struct { Guid string Time int64 FormulaID string Exitcode int Results struct { Keys []OutputName Values map[OutputName]FormulaInputSimple } }
type SandboxPath ¶
type SandboxPath string
type SandboxPort ¶
type SandboxPort struct { // FIXME: although golang has permitted us to use this as a map key... we shouldn't; it's trouble. // The pointers here mean that constructing an equal value is nearly possible, which is unintended and unpleasant to use. // Fixing this may require some work upstream in go-ipld-prime's bindnode package: // in order to stop using pointers here, it will need to support integer indicators instead. SandboxPath *SandboxPath SandboxVar *SandboxVar }
type SandboxVar ¶
type SandboxVar string
type Step ¶
type Step struct { Plot *Plot Protoformula *Protoformula }
type StepName ¶
type StepName string
StepName is for assigning string names to Steps in a Plot. StepNames will be part of wiring things together using Pipes.
Must not contain ':' charaters or unprintables or whitespace.
type WareID ¶
type WarehouseAddr ¶
type WarehouseAddr string
WarehouseAddr is typically parsed as roughly a URL, but we don't deal with that at the API type level.