Documentation ¶
Index ¶
- Variables
- type ComponentFinder
- type ConfigTemplate
- type MultiError
- type PushConfig
- type RawBuilderConfig
- type RawPostProcessorConfig
- type RawProvisionerConfig
- type RawVariable
- type Template
- type TemplateOnlyExcept
- type WorkflowController
- func (this *WorkflowController) ExecutePipelineChain(socketEvent smodel.SocketEvent)
- func (this *WorkflowController) GetFeed() *interface{}
- func (this *WorkflowController) GetHumanByUID(uid string) *population.HumanController
- func (this *WorkflowController) GetManager() *WorkflowManager
- func (this *WorkflowController) GetProfiler() *model.Profiler
- func (this *WorkflowController) Init()
- func (this *WorkflowController) RegisterHuman(human *population.HumanController)
- func (this *WorkflowController) UnregisterHuman(human *population.HumanController)
- type WorkflowManager
- func (this *WorkflowManager) BindServiceEvents()
- func (this *WorkflowManager) BindStreamServiceEvents()
- func (this *WorkflowManager) CreateWorkflowFeed(feed *resource.Feed) *WorkflowController
- func (this *WorkflowManager) FindWorkflowByFeedId(id string) (workflow *WorkflowController, err error)
- func (this *WorkflowManager) GetEngine() emodel.Elasticfeed
- func (this *WorkflowManager) GetStreamService() *stream.StreamService
- func (this *WorkflowManager) Init()
- func (this *WorkflowManager) InitTemplate(t interface{})
- func (this *WorkflowManager) InstallFeedMaintenanceSchedule()
- func (this *WorkflowManager) InstallSensorsSchedule()
- func (this *WorkflowManager) ResourceCrawlerRound(socketEvent smodel.SocketEvent)
- func (this *WorkflowManager) ResourceIndexerRound(socketEvent smodel.SocketEvent)
- func (this *WorkflowManager) ResourcePipelineRound(socketEvent smodel.SocketEvent)
- func (this *WorkflowManager) ResourceScenarioRound(socketEvent smodel.SocketEvent)
- func (this *WorkflowManager) ResourceSensorRound(socketEvent smodel.SocketEvent)
Constants ¶
This section is empty.
Variables ¶
var InitTime time.Time
InitTime is the UTC time when this package was initialized. It is used as the timestamp for all configuration templates so that they match for a single build.
Functions ¶
This section is empty.
Types ¶
type ConfigTemplate ¶
ConfigTemplate processes string data as a text/template with some common elements and functions available. Plugin creators should process as many fields as possible through this.
func NewConfigTemplate ¶
func NewConfigTemplate() (*ConfigTemplate, error)
NewConfigTemplate creates a new configuration template processor.
func (*ConfigTemplate) Funcs ¶
func (t *ConfigTemplate) Funcs(funcs template.FuncMap)
Add additional functions to the template
func (*ConfigTemplate) Process ¶
func (t *ConfigTemplate) Process(s string, data interface{}) (string, error)
Process processes a single string, compiling and executing the template.
func (*ConfigTemplate) Validate ¶
func (t *ConfigTemplate) Validate(s string) error
Validate the template.
type MultiError ¶
type MultiError struct {
Errors []error
}
MultiError is an error type to track multiple errors. This is used to accumulate errors in cases such as configuration parsing, and returning them as a single error.
func MultiErrorAppend ¶
func MultiErrorAppend(err error, errs ...error) *MultiError
MultiErrorAppend is a helper function that will append more errors onto a MultiError in order to create a larger multi-error. If the original error is not a MultiError, it will be turned into one.
func (*MultiError) Error ¶
func (e *MultiError) Error() string
type PushConfig ¶
type PushConfig struct { Name string Address string BaseDir string `mapstructure:"base_dir"` Include []string Exclude []string Token string VCS bool }
PushConfig is the configuration structure for the push settings.
type RawBuilderConfig ¶
The RawBuilderConfig struct represents a raw, unprocessed builder configuration. It contains the name of the builder as well as the raw configuration. If requested, this is used to compile into a full builder configuration at some point.
type RawPostProcessorConfig ¶
type RawPostProcessorConfig struct { TemplateOnlyExcept `mapstructure:",squash"` Type string KeepInputArtifact bool `mapstructure:"keep_input_artifact"` RawConfig map[string]interface{} }
RawPostProcessorConfig represents a raw, unprocessed post-processor configuration. It contains the type of the post processor as well as the raw configuration that is handed to the post-processor for it to process.
type RawProvisionerConfig ¶
type RawProvisionerConfig struct { TemplateOnlyExcept `mapstructure:",squash"` Type string Override map[string]interface{} RawPauseBefore string `mapstructure:"pause_before"` RawConfig interface{} // contains filtered or unexported fields }
RawProvisionerConfig represents a raw, unprocessed provisioner configuration. It contains the type of the provisioner as well as the raw configuration that is handed to the provisioner for it to process.
type RawVariable ¶
type RawVariable struct { Default string // The default value for this variable Required bool // If the variable is required or not Value string // The set value for this variable HasValue bool // True if the value was set }
RawVariable represents a variable configuration within a template.
type Template ¶
type Template struct { RawContents []byte Description string Variables map[string]RawVariable Builders map[string]RawBuilderConfig Hooks map[string][]string Push *PushConfig PostProcessors [][]RawPostProcessorConfig Provisioners []RawProvisionerConfig }
The Template struct represents a parsed template, parsed into the most completed form it can be without additional processing by the caller.
func ParseTemplate ¶
ParseTemplate takes a byte slice and parses a Template from it, returning the template and possibly errors while loading the template. The error could potentially be a MultiError, representing multiple errors. Knowing and checking for this can be useful, if you wish to format it in a certain way.
The second parameter, vars, are the values for a set of user variables.
func ParseTemplateFile ¶
ParseTemplateFile takes the given template file and parses it into a single template.
func (*Template) Build ¶
func (t *Template) Build(name string, components *ComponentFinder) (b interface{}, err error)
Build returns a Build for the given name.
If the build does not exist as part of this template, an error is returned. func (t *Template) Build(name string, components *ComponentFinder) (b Build, err error) {
func (*Template) BuildNames ¶
BuildNames returns a slice of the available names of builds that this template represents.
func (*Template) NewConfigTemplate ¶
func (t *Template) NewConfigTemplate() (c *ConfigTemplate, variables map[string]string, err error)
Build a ConfigTemplate object populated by the values within a parsed template
type TemplateOnlyExcept ¶
TemplateOnlyExcept contains the logic required for "only" and "except" meta-parameters.
func (*TemplateOnlyExcept) Prune ¶
func (t *TemplateOnlyExcept) Prune(raw map[string]interface{})
Prune will prune out the used values from the raw map.
func (*TemplateOnlyExcept) Skip ¶
func (t *TemplateOnlyExcept) Skip(name string) bool
Skip tests if we should skip putting this item onto a build.
func (*TemplateOnlyExcept) Validate ¶
func (t *TemplateOnlyExcept) Validate(b map[string]RawBuilderConfig) (e []error)
Validates the only/except parameters.
type WorkflowController ¶
type WorkflowController struct { IndexerTimeout int CrawlerTimeout int SensorTimeout int PipelineTimeout int ScenarioTimeout int // contains filtered or unexported fields }
func NewWorkflowController ¶
func NewWorkflowController(feed *resource.Feed, wm *WorkflowManager) *WorkflowController
func (*WorkflowController) ExecutePipelineChain ¶
func (this *WorkflowController) ExecutePipelineChain(socketEvent smodel.SocketEvent)
func (*WorkflowController) GetFeed ¶
func (this *WorkflowController) GetFeed() *interface{}
func (*WorkflowController) GetHumanByUID ¶
func (this *WorkflowController) GetHumanByUID(uid string) *population.HumanController
func (*WorkflowController) GetManager ¶
func (this *WorkflowController) GetManager() *WorkflowManager
func (*WorkflowController) GetProfiler ¶
func (this *WorkflowController) GetProfiler() *model.Profiler
func (*WorkflowController) Init ¶
func (this *WorkflowController) Init()
func (*WorkflowController) RegisterHuman ¶
func (this *WorkflowController) RegisterHuman(human *population.HumanController)
func (*WorkflowController) UnregisterHuman ¶
func (this *WorkflowController) UnregisterHuman(human *population.HumanController)
type WorkflowManager ¶
type WorkflowManager struct {
// contains filtered or unexported fields
}
func NewWorkflowManager ¶
func NewWorkflowManager(engine emodel.Elasticfeed) *WorkflowManager
func (*WorkflowManager) BindServiceEvents ¶
func (this *WorkflowManager) BindServiceEvents()
func (*WorkflowManager) BindStreamServiceEvents ¶
func (this *WorkflowManager) BindStreamServiceEvents()
func (*WorkflowManager) CreateWorkflowFeed ¶
func (this *WorkflowManager) CreateWorkflowFeed(feed *resource.Feed) *WorkflowController
func (*WorkflowManager) FindWorkflowByFeedId ¶
func (this *WorkflowManager) FindWorkflowByFeedId(id string) (workflow *WorkflowController, err error)
func (*WorkflowManager) GetEngine ¶
func (this *WorkflowManager) GetEngine() emodel.Elasticfeed
func (*WorkflowManager) GetStreamService ¶
func (this *WorkflowManager) GetStreamService() *stream.StreamService
func (*WorkflowManager) Init ¶
func (this *WorkflowManager) Init()
func (*WorkflowManager) InitTemplate ¶
func (this *WorkflowManager) InitTemplate(t interface{})
func (*WorkflowManager) InstallFeedMaintenanceSchedule ¶
func (this *WorkflowManager) InstallFeedMaintenanceSchedule()
func (*WorkflowManager) InstallSensorsSchedule ¶
func (this *WorkflowManager) InstallSensorsSchedule()
func (*WorkflowManager) ResourceCrawlerRound ¶
func (this *WorkflowManager) ResourceCrawlerRound(socketEvent smodel.SocketEvent)
func (*WorkflowManager) ResourceIndexerRound ¶
func (this *WorkflowManager) ResourceIndexerRound(socketEvent smodel.SocketEvent)
func (*WorkflowManager) ResourcePipelineRound ¶
func (this *WorkflowManager) ResourcePipelineRound(socketEvent smodel.SocketEvent)
func (*WorkflowManager) ResourceScenarioRound ¶
func (this *WorkflowManager) ResourceScenarioRound(socketEvent smodel.SocketEvent)
func (*WorkflowManager) ResourceSensorRound ¶
func (this *WorkflowManager) ResourceSensorRound(socketEvent smodel.SocketEvent)