Documentation ¶
Index ¶
- func Getenv(key, def string) string
- func LoadGraph(ctx context.Context, graphName string, opts ...Option) (*ProcessingGraph, GraphConfig, GraphEnvs, error)
- func LoadGraphFromFile(ctx context.Context, graphFile string, opts ...Option) (*ProcessingGraph, GraphConfig, GraphEnvs, error)
- func WithDockerManager(dockerManager DockerManager) interface{ ... }
- func WithSnap() interface{ ... }
- type Arg
- type ArgConfig
- type ArgFixed
- type ArgIn
- type ArgJSON
- type ArgOut
- type ArgTile
- type CmdLogFilter
- type DType
- type DockerConfig
- type DockerLogFilter
- type DockerManager
- type File
- type GraphConfig
- type GraphEnvs
- type InFile
- type LogFilter
- type Option
- type OutFile
- type OutFileAction
- type ProcessingGraph
- type ProcessingGraphJSON
- type ProcessingStep
- type PythonLogFilter
- type SNAPLogFilter
- type TileCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Getenv ¶
Getenv retrieves the value of the environment variable named by the key. Return def if not set
func LoadGraph ¶
func LoadGraph(ctx context.Context, graphName string, opts ...Option) (*ProcessingGraph, GraphConfig, GraphEnvs, error)
LoadGraph returns the graph from its name and its default configuration
func LoadGraphFromFile ¶
func LoadGraphFromFile(ctx context.Context, graphFile string, opts ...Option) (*ProcessingGraph, GraphConfig, GraphEnvs, error)
LoadGraphFromFile returns the graph from a filename
func WithDockerManager ¶ added in v1.0.0
func WithDockerManager(dockerManager DockerManager) interface { Option }
Types ¶
type CmdLogFilter ¶ added in v1.0.0
type CmdLogFilter struct {
// contains filtered or unexported fields
}
CmdLogFilter formats log from other commands
func (*CmdLogFilter) WrapError ¶ added in v1.0.0
func (f *CmdLogFilter) WrapError(err error) error
WrapError implements LogFilter
type DType ¶
type DType int32
DType of an output file
DType of an output file
func DTypeFromString ¶
func (*DType) UnmarshalJSON ¶
type DockerConfig ¶ added in v1.0.0
type DockerConfig struct { Envs []string RegistryServer string // "https://eu.gcr.io" for gcs RegistryUserName string // _json_key for gcs RegistryPassword string // service account for gcs VolumesToMount string // List of volumes to mount (comma separated) }
func (*DockerConfig) SetFlags ¶ added in v1.0.0
func (cfg *DockerConfig) SetFlags() *string
SetFlags configures flag for a docker config Returns dockerEnvs as string, comma sep.
cfg := DockerConfig{} dockerEnvsStr := cfg.Flags()
flag.Parse()
if *dockerEnvsStr != "" { cfg.Envs = strings.Split(*dockerEnvsStr, ",") }
type DockerLogFilter ¶ added in v1.0.0
type DockerLogFilter struct {
// contains filtered or unexported fields
}
DockerLogFilter formats log from docker Engine
func (*DockerLogFilter) WrapError ¶ added in v1.0.0
func (f *DockerLogFilter) WrapError(err error) error
type DockerManager ¶ added in v1.0.0
type DockerManager interface {
Process(ctx context.Context, cmd, workdir string, args []string, envs []string) error
}
func NewDockerManager ¶ added in v1.0.0
func NewDockerManager(ctx context.Context, config DockerConfig) (DockerManager, error)
type File ¶
type File struct { Layer service.Layer `json:"layer"` Extension service.Extension `json:"extension"` }
File is a layer with an extension
type GraphConfig ¶
GraphConfig is a configuration map for a processing graph
func PhrDefaultConfig ¶ added in v1.0.0
func PhrDefaultConfig() GraphConfig
func S1DefaultConfig ¶
func S1DefaultConfig() GraphConfig
S1DefaultConfig returns a basic configuration
func SpotDefaultConfig ¶ added in v1.0.0
func SpotDefaultConfig() GraphConfig
type GraphEnvs ¶ added in v1.0.0
type GraphEnvs []string
GraphEnvs is a configuration map for a processing graph
type InFile ¶
type InFile struct { File Condition TileCondition `json:"condition"` }
InFile describes an input file of the processing
func (*InFile) UnmarshalJSON ¶
type OutFile ¶
type OutFile struct { File DType DType `json:"datatype"` NoData float64 `json:"nodata"` Min float64 `json:"min_value"` Max float64 `json:"max_value"` ExtMin float64 `json:"ext_min_value"` ExtMax float64 `json:"ext_max_value"` Exponent float64 `json:"exponent"` // JSON default: 1 Nbands int `json:"nbands"` // JSON default: 1 Action OutFileAction `json:"action"` Condition TileCondition `json:"condition"` // JSON default: pass // contains filtered or unexported fields }
OutFile describes an output file of the processing
func (*OutFile) UnmarshalJSON ¶
type OutFileAction ¶
type OutFileAction int32
OutFileAction
const ( ToIgnore OutFileAction = iota ToCreate ToIndex ToDelete )
OutFileAction
func (*OutFileAction) UnmarshalJSON ¶
func (a *OutFileAction) UnmarshalJSON(data []byte) error
type ProcessingGraph ¶
type ProcessingGraph struct { InFiles [3][]InFile // contains filtered or unexported fields }
ProcessingGraph is a set of steps
func (*ProcessingGraph) Process ¶
func (g *ProcessingGraph) Process(ctx context.Context, config GraphConfig, graphEnvs GraphEnvs, tiles []common.Tile) ([][]OutFile, error)
Process runs the graph Returns the files to create or to delete
func (*ProcessingGraph) Summary ¶
func (g *ProcessingGraph) Summary() string
type ProcessingGraphJSON ¶
type ProcessingStep ¶
type ProcessingStep struct { Engine string // Python or Snap Command string Args map[string]Arg Condition TileCondition }
func (*ProcessingStep) UnmarshalJSON ¶
func (a *ProcessingStep) UnmarshalJSON(data []byte) error
type PythonLogFilter ¶
type PythonLogFilter struct {
// contains filtered or unexported fields
}
PythonLogFilter formats log from python
func (*PythonLogFilter) Filter ¶
func (f *PythonLogFilter) Filter(msg string, defaultLevel zapcore.Level) (string, zapcore.Level, bool)
Filter implement log.Filter
func (*PythonLogFilter) WrapError ¶
func (f *PythonLogFilter) WrapError(err error) error
WrapError implements LogFilter
type SNAPLogFilter ¶
type SNAPLogFilter struct {
// contains filtered or unexported fields
}
SNAPLogFilter formats log from ESA/SNAP
func (*SNAPLogFilter) Filter ¶
func (f *SNAPLogFilter) Filter(msg string, defaultLevel zapcore.Level) (string, zapcore.Level, bool)
Filter implement log.Filter
func (*SNAPLogFilter) WrapError ¶
func (f *SNAPLogFilter) WrapError(err error) error
WrapError implements LogFilter
type TileCondition ¶
TileCondition is a condition on tiles to do an action (execute a step, create a file...)
func (*TileCondition) UnmarshalJSON ¶
func (t *TileCondition) UnmarshalJSON(data []byte) error