Documentation ¶
Index ¶
- Constants
- type Appendable
- type Caretakerd
- func (instance *Caretakerd) Close()
- func (instance *Caretakerd) ConfigObject() interface{}
- func (instance *Caretakerd) Control() *control.Control
- func (instance Caretakerd) IsOpen() bool
- func (instance *Caretakerd) KeyStore() *keyStore.KeyStore
- func (instance Caretakerd) Logger() *logger.Logger
- func (instance *Caretakerd) Run() (values.ExitCode, error)
- func (instance *Caretakerd) Services() *service.Services
- func (instance *Caretakerd) Stop()
- type Config
- type ConfigDoesNotExistError
- type Executable
- type Execution
- func (instance *Execution) GetCountOfActiveExecutions() int
- func (instance *Execution) GetFor(s *service.Service) (*service.Execution, bool)
- func (instance *Execution) Information() map[string]service.Information
- func (instance *Execution) InformationFor(s *service.Service) service.Information
- func (instance *Execution) Kill(target *service.Service) error
- func (instance *Execution) Restart(target *service.Service) error
- func (instance *Execution) Run() (values.ExitCode, error)
- func (instance *Execution) Signal(target *service.Service, what values.Signal) error
- func (instance *Execution) Start(target *service.Service) error
- func (instance *Execution) Stop(target *service.Service) error
- func (instance *Execution) StopAll()
- type Putable
Constants ¶
const ( // Version contains the current version of caretakerd Version = "${project.version}" // BaseName contains the base name of caretaker executable BaseName = "caretaker" // DaemonName contains the name of caretakerd executable DaemonName = "caretakerd" // ControlName contains the name of caretakerctl executable ControlName = "caretakerctl" // Description contains the description of caretakerd. Description = "${project.description}" // URL contains the URL of caretakerd project page. URL = "${project.url}" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Appendable ¶
Appendable indicates an instance where a string could be appended.
type Caretakerd ¶
type Caretakerd struct {
// contains filtered or unexported fields
}
Caretakerd instance structure
func NewCaretakerd ¶
func NewCaretakerd(conf Config, syncGroup *usync.Group) (*Caretakerd, error)
NewCaretakerd create a new Caretakerd instance from given config
func (*Caretakerd) Close ¶
func (instance *Caretakerd) Close()
Close close the caretakerd instance and free resoruces. After call of this method it is not longer possible to use this instance.
func (*Caretakerd) ConfigObject ¶
func (instance *Caretakerd) ConfigObject() interface{}
ConfigObject return config this instances was created with.
func (*Caretakerd) Control ¶
func (instance *Caretakerd) Control() *control.Control
Control return instantiated control that belongs to this instance.
func (Caretakerd) IsOpen ¶
func (instance Caretakerd) IsOpen() bool
IsOpen return true if caretakerd is still open. This should be false after Close() was called.
func (*Caretakerd) KeyStore ¶
func (instance *Caretakerd) KeyStore() *keyStore.KeyStore
KeyStore return instantiated keyStore that belongs to this instance.
func (Caretakerd) Logger ¶
func (instance Caretakerd) Logger() *logger.Logger
Logger return instantiated logger that belongs to this instance.
func (*Caretakerd) Run ¶
func (instance *Caretakerd) Run() (values.ExitCode, error)
Run starts every services and requird resources of caretakerd. This method is blocking.
func (*Caretakerd) Services ¶
func (instance *Caretakerd) Services() *service.Services
Services return instantiated services that belongs to this instance.
func (*Caretakerd) Stop ¶
func (instance *Caretakerd) Stop()
Stop stops this instance (if running). This method is blocking until every service and resource is stopped.
type Config ¶
type Config struct { // Defines how the encryption of caretakerd works. // This is especially important if {@ref #RPC RPC} is used. // // For details see {@ref github.com/echocat/caretakerd/keyStore.Config}. KeyStore keyStore.Config `json:"keyStore" yaml:"keyStore,omitempty"` // Defines how caretaker can controlled remotely. // // For details see {@ref github.com/echocat/caretakerd/rpc.Config}. RPC rpc.Config `json:"rpc" yaml:"rpc,omitempty"` // Defines the access rights of caretakerctl to caretakerd. // This requires {@ref #RPC RPC} enabled. // // For details see {@ref github.com/echocat/caretakerd/control.Config}. Control control.Config `json:"control" yaml:"control,omitempty"` // Configures the logger for caretakerd itself. // This does not include output of services. // // For details see {@ref github.com/echocat/caretakerd/logger.Config}. Logger logger.Config `json:"logger" yaml:"logger,omitempty"` // Services configuration to run with caretakerd. // // > **Important**: This is a map and requires exact one service // > configured as {@ref github.com/echocat/caretakerd/service.Config#Type type} = {@ref github.com/echocat/caretakerd/service.Type#Master master}. // // For details see {@ref github.com/echocat/caretakerd/service.Config}. Services service.Configs `json:"services" yaml:"services,omitempty"` }
Root configuration of caretakerd.
func LoadFromYamlFile ¶
LoadFromYamlFile loads caretakerd config from given yaml file.
func (*Config) BeforeUnmarshalYAML ¶
BeforeUnmarshalYAML is used by yaml unmarcshalling. Do not call direct.
func (Config) EnrichFromEnvironment ¶
EnrichFromEnvironment enrich the current Config instance with configuration from the environment variables.
func (Config) Validate ¶
Validate do validate action on this object and return an error object if any.
func (Config) ValidateMaster ¶
ValidateMaster return an error instance on every validation problem of the master service config instance.
type ConfigDoesNotExistError ¶
type ConfigDoesNotExistError struct {
// contains filtered or unexported fields
}
ConfigDoesNotExistError descripts an error if a config does not exists.
func (ConfigDoesNotExistError) Error ¶
func (instance ConfigDoesNotExistError) Error() string
Error return the error message.
type Executable ¶
type Executable interface { Services() *service.Services KeyStore() *keyStore.KeyStore Logger() *logger.Logger }
Executable indicates an object that could be executed.
type Execution ¶
type Execution struct {
// contains filtered or unexported fields
}
Execution is an instance of an execution of every service of caretakerd.
func NewExecution ¶
func NewExecution(executable Executable) *Execution
NewExecution create a new Execution instance of caretakerd.
Hint: A caretakerd Execution instance could only be called once.
func (*Execution) GetCountOfActiveExecutions ¶
GetCountOfActiveExecutions return number of active execution of services.
func (*Execution) GetFor ¶
GetFor get the current active service exectuion for the given service. Return false if there is no current matching execution.
func (*Execution) Information ¶
func (instance *Execution) Information() map[string]service.Information
Information return an information object that contain an information for every configured service.
func (*Execution) InformationFor ¶
func (instance *Execution) InformationFor(s *service.Service) service.Information
InformationFor return an information object for given service.
func (*Execution) Run ¶
Run starts the caretakerd Execution and start also every service and required resource. This method is blocking.