Documentation ¶
Overview ¶
package config
Index ¶
- Constants
- Variables
- type ArgoConf
- type ArgoSubmitOptsGenerator
- type ArgoTemplate
- type ArgoWorkflowOpts
- type ArgoWorkflowParameters
- type Callback
- type CallbackParameter
- type CallbackParameters
- type CallbackType
- type CallbackWhen
- type Callbacks
- type CirrusWorkflowOpts
- type Conductor
- type Conductors
- type ConfigFile
- type Handler
- type HandlerParameters
- type HandlerSecret
- type HandlerType
- type Handlers
- type K8sOptions
- type Labels
- type SwoopConfig
- type Workflow
- type Workflows
Constants ¶
View Source
const SwoopWorkflowIdLabelName = "swoop.element84.com/workflowId"
Variables ¶
View Source
var CallbackTypes = map[CallbackType]struct{}{ SingleCallback: {}, PerFeatureCallback: {}, }
View Source
var HandlerTypes = map[HandlerType]struct{}{ Noop: {}, SyncHttp: {}, ArgoWorkflows: {}, Cirrus: {}, }
Functions ¶
This section is empty.
Types ¶
type ArgoConf ¶
type ArgoConf struct { InstanceId string `yaml:"instanceId"` K8sOptions *K8sOptions `yaml:"k8sOptions"` }
func (*ArgoConf) GetConfig ¶
func (ac *ArgoConf) GetConfig() clientcmd.ClientConfig
func (*ArgoConf) GetNamespace ¶
type ArgoSubmitOptsGenerator ¶
type ArgoSubmitOptsGenerator func(wfUuid uuid.UUID, priority int) *wfv1.SubmitOpts
type ArgoTemplate ¶
func (*ArgoTemplate) UnmarshalYAML ¶
func (at *ArgoTemplate) UnmarshalYAML(unmarshal func(interface{}) error) error
type ArgoWorkflowOpts ¶
type ArgoWorkflowOpts struct { Template *ArgoTemplate `yaml:"template"` Parameters ArgoWorkflowParameters `yaml:"parameters"` ServiceAccount string `yaml:"serviceAccount"` Labels Labels `yaml:"labels"` Annotations Labels `yaml:"annotations"` }
func (*ArgoWorkflowOpts) SetWorkflowIdLabel ¶
func (awo *ArgoWorkflowOpts) SetWorkflowIdLabel(id string) error
func (*ArgoWorkflowOpts) SubmitOptsGenerator ¶
func (awo *ArgoWorkflowOpts) SubmitOptsGenerator() (ArgoSubmitOptsGenerator, error)
func (*ArgoWorkflowOpts) UnmarshalYAML ¶
func (awo *ArgoWorkflowOpts) UnmarshalYAML(unmarshal func(interface{}) error) error
type ArgoWorkflowParameters ¶
func (ArgoWorkflowParameters) StringArray ¶
func (p ArgoWorkflowParameters) StringArray() (params []string)
func (*ArgoWorkflowParameters) UnmarshalYAML ¶
func (p *ArgoWorkflowParameters) UnmarshalYAML(unmarshal func(interface{}) error) error
func (ArgoWorkflowParameters) Validate ¶
func (p ArgoWorkflowParameters) Validate() error
type Callback ¶
type Callback struct { Name string `yaml:"-"` HandlerName string `yaml:"handler"` Type CallbackType `yaml:"type"` // TODO: need to parse filter into a type FeatureFilter string `yaml:"featureFilter,omitempty"` When *CallbackWhen `yaml:"when"` Parameters *CallbackParameters `yaml:"parameters,omitempty"` Handler *Handler `yaml:"-"` }
func (*Callback) ValidateParams ¶
type CallbackParameter ¶
type CallbackParameters ¶
type CallbackParameters map[string]*CallbackParameter
type CallbackType ¶
type CallbackType string
const ( SingleCallback CallbackType = "single" PerFeatureCallback CallbackType = "perfeature" )
func ParseCallbackType ¶
func ParseCallbackType(s string) (CallbackType, error)
func (CallbackType) String ¶
func (cbt CallbackType) String() string
func (*CallbackType) UnmarshalYAML ¶
func (cbt *CallbackType) UnmarshalYAML(unmarshal func(interface{}) error) error
type CallbackWhen ¶
type CallbackWhen []states.FinalState
func (*CallbackWhen) UnmarshalYAML ¶
func (cw *CallbackWhen) UnmarshalYAML(unmarshal func(interface{}) error) error
type Callbacks ¶
func (*Callbacks) UnmarshalYAML ¶
type CirrusWorkflowOpts ¶
type CirrusWorkflowOpts struct {
SfnArn string `yaml:"sfnArn"`
}
type Conductors ¶
type ConfigFile ¶
type ConfigFile struct {
// contains filtered or unexported fields
}
func (*ConfigFile) AddFlags ¶
func (cf *ConfigFile) AddFlags(fs *pflag.FlagSet)
func (*ConfigFile) Parse ¶
func (cf *ConfigFile) Parse() (*SwoopConfig, error)
type Handler ¶
type Handler struct { Name string `yaml:"-"` Type HandlerType `yaml:"type"` // TODO: need a backoff type Backoff map[string]int `yaml:"backoff"` Parameters *HandlerParameters `yaml:"parameters"` Secrets []*HandlerSecret `yaml:"secrets"` Workflows []*Workflow `yaml:"-"` HttpClient *http.Client `yaml:"request,omitempty"` ArgoConf *ArgoConf `yaml:"argoConf,omitempty"` }
func (*Handler) UnmarshalYAML ¶
type HandlerParameters ¶
type HandlerParameters jsonschema.Schema
func (*HandlerParameters) UnmarshalYAML ¶
func (p *HandlerParameters) UnmarshalYAML(unmarshal func(interface{}) error) error
func (*HandlerParameters) Validate ¶
func (p *HandlerParameters) Validate(data any) error
type HandlerSecret ¶
type HandlerSecret struct { Name string `yaml:"name"` Type string `yaml:"type"` Path string `yaml:"path"` TTL int `yaml:"ttl"` }
TODO: how does this even work?
I think we need another type to actually fetch/retrive the value? Or maybe it just checks the value at read time, and if enough time has passed since last read it tries to read again? If error on read after startup use last value and log error -> next read should be scheduled, and we can use that to backoff reads on error
type HandlerType ¶
type HandlerType string
const ( Noop HandlerType = "noop" SyncHttp HandlerType = "synchttp" ArgoWorkflows HandlerType = "argoworkflows" Cirrus HandlerType = "cirrus" )
func ParseHandlerType ¶
func ParseHandlerType(s string) (HandlerType, error)
func (HandlerType) String ¶
func (cbt HandlerType) String() string
func (*HandlerType) UnmarshalYAML ¶
func (ht *HandlerType) UnmarshalYAML(unmarshal func(interface{}) error) error
type Handlers ¶
func (*Handlers) UnmarshalYAML ¶
type K8sOptions ¶
type K8sOptions struct { Kubeconfig string `yaml:"kubeconfig"` ConfigOverrides *clientcmd.ConfigOverrides `yaml:"configOverrides"` }
type Labels ¶
func (*Labels) UnmarshalYAML ¶
type SwoopConfig ¶
type SwoopConfig struct { Workflows Workflows `yaml:"workflows"` Handlers Handlers `yaml:"handlers"` Conductors Conductors `yaml:"conductors"` }
func Parse ¶
func Parse(configFile string) (*SwoopConfig, error)
func (*SwoopConfig) LinkAndValidate ¶
func (sc *SwoopConfig) LinkAndValidate() error
func (*SwoopConfig) UnmarshalYAML ¶
func (sc *SwoopConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
TODO: using this pattern in many places -> make a generic unmarshal function that takes an interface with a postUnmarshal
function or something that can be used to run validation and other such steps
type Workflow ¶
type Workflow struct { Id string HandlerName string `yaml:"handler"` Callbacks Callbacks `yaml:"callbacks"` ArgoOpts *ArgoWorkflowOpts `yaml:"argoOpts,omitempty"` CirrusOpts *CirrusWorkflowOpts `yaml:"cirrusOpts,omitempty"` // contains filtered or unexported fields }
func (*Workflow) GetHandler ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.