config

package
v0.0.0-...-0490640 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeleteNodes int = iota
	NodesMissing
	MissingNodesForDeletion
)

Enum jobs

Variables

View Source
var JobList = map[int]string{
	DeleteNodes:             "delete_nodes",
	NodesMissing:            "missing_nodes",
	MissingNodesForDeletion: "missing_nodes_for_deletion",
}

List of jobs

Functions

This section is empty.

Types

type JobConfig

type JobConfig struct {
	// The ID of the job
	ID int `toml:"id"`
	// The threshold time that the job will use internally to do a task
	Threshold string `toml:"threshold"`
	// How often to run the job
	Every string `toml:"every"`
	// Is the job running
	Running bool `toml:"running"`
}

JobConfig is the config for a job

func (*JobConfig) ApplyJobSettings

func (jc *JobConfig) ApplyJobSettings(settings *ingest.JobSettings) (bool, error)

ApplyJobSettings will apply the provided settings to the job configuration returns 'true' if the configuration was modified to indicate that an update is needed

func (*JobConfig) JobName

func (jc *JobConfig) JobName() string

JobName is the name of the job

type JobSchedulerConfig

type JobSchedulerConfig struct {
	// Is the job scheduler running
	Running bool `toml:"running"`
}

JobSchedulerConfig - the config for the job scheduler

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager - configuration manager for the service

func NewManager

func NewManager(configFile string) (*Manager, error)

NewManager - create a new config. There should only be one config for the service.

func (*Manager) Close

func (manager *Manager) Close()

Close - close channels

func (*Manager) GetDeleteNodesSchedulerConfig

func (manager *Manager) GetDeleteNodesSchedulerConfig() JobConfig

GetDeleteNodesSchedulerConfig get the delete node config

func (*Manager) GetJobConfig

func (manager *Manager) GetJobConfig(jID int) JobConfig

GetJobConfig returns the configuration of the provided job. if the job doesn't exist, it returns an empty config

func (*Manager) GetJobSchedulerConfig

func (manager *Manager) GetJobSchedulerConfig() JobSchedulerConfig

GetJobSchedulerConfig get the job scheduler config

func (*Manager) GetJobsID

func (manager *Manager) GetJobsID() []int

GetJobsID returns a list of job ids loaded in the manager config

func (*Manager) GetMissingNodesForDeletionSchedulerConfig

func (manager *Manager) GetMissingNodesForDeletionSchedulerConfig() JobConfig

GetMissingNodesForDeletionSchedulerConfig get the node missing config

func (*Manager) GetNodesMissingSchedulerConfig

func (manager *Manager) GetNodesMissingSchedulerConfig() JobConfig

GetNodesMissingSchedulerConfig get the node missing config

func (*Manager) GetProjectUpdateConfig

func (manager *Manager) GetProjectUpdateConfig() project_update_lib.ProjectUpdateConfig

GetProjectUpdateConfig - get the project update config data

func (*Manager) UpdateDeleteNodesSchedulerConfig

func (manager *Manager) UpdateDeleteNodesSchedulerConfig(jConfig JobConfig) error

UpdateDeleteNodesSchedulerConfig - update the delete node config

func (*Manager) UpdateJobSchedulerConfig

func (manager *Manager) UpdateJobSchedulerConfig(jobSchedulerConfig JobSchedulerConfig) error

UpdateJobSchedulerConfig - update the job scheduler config

func (*Manager) UpdateMissingNodesForDeletionSchedulerConfig

func (manager *Manager) UpdateMissingNodesForDeletionSchedulerConfig(jConfig JobConfig) error

UpdateMissingNodesForDeletionSchedulerConfig update the missing nodes for deletion config

func (*Manager) UpdateNodesMissingSchedulerConfig

func (manager *Manager) UpdateNodesMissingSchedulerConfig(jConfig JobConfig) error

UpdateNodesMissingSchedulerConfig update the missing nodes for deletion task

func (*Manager) UpdateProjectUpdateConfig

func (manager *Manager) UpdateProjectUpdateConfig(projectUpdateConfig project_update_lib.ProjectUpdateConfig) error

UpdateProjectUpdateConfig - update the project update config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL