 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
var ( // ErrMissingApplications is returned when no applications // have been configured for the orchestrator ErrMissingApplications = errors.New("missing applications") // ErrMissingGatherTimeout is returned when no scatter- // gather timeout has been configured. ErrMissingGatherTimeout = errors.New("missing gather timeout") // ErrInvalidGatherChanSize is returned when no scatter- // gather channel size has been configured. ErrInvalidGatherChanSize = errors.New("gather channel size must be greater than zero") )
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
	Name       string  `json:"name"`
	Schedule   string  `json:"schedule"`
	Percentage float64 `json:"percentage"`
}
    Application represents an application the Orchestrator can kill.
type Config ¶
type Config struct {
	NatsHosts      []string             `json:"natsHosts"`
	NatsUser       string               `json:"natsUser"`
	NatsPass       string               `json:"natsPass"`
	GatherTimeout  model.ConfigDuration `json:"gatherTimeout"`
	GatherChanSize int                  `json:"gatherChanSize"`
	LogLevel model.ConfigLogLevel `json:"logLevel"`
	Applications Applications `json:"applications"`
}
    Config holds the configuration variables an orchestrator needs to run.
func NewConfigFromReader ¶
NewConfigFromReader loads Orchestrator configuration from a given file path and returns any errors encountered.
type Orchestrator ¶
type Orchestrator struct {
	// contains filtered or unexported fields
}
    Orchestrator holds the necessary information to process Application instances.
func NewOrchestrator ¶
func NewOrchestrator(c *Config, processor Processor, logger *logrus.Logger) (o *Orchestrator, err error)
NewOrchestrator returns a pointer to a new instance of an Orchestrator.
func (*Orchestrator) Process ¶
func (o *Orchestrator) Process(a Application)
Process makes a request for Applications and the performs a set of kill operations on them.
func (*Orchestrator) Start ¶
func (o *Orchestrator) Start()
Start begins a number of jobs to process each of the applications configured in the Orchestrator's config file. NOTE: Needs to be run in a goroutine
 Click to show internal directories. 
   Click to hide internal directories.