Documentation
¶
Index ¶
- type ChanneledTransport
- func (t *ChanneledTransport) Close() error
- func (t *ChanneledTransport) IsClosed() bool
- func (t *ChanneledTransport) Off() (sigSent bool)
- func (t *ChanneledTransport) On() (sigSent bool)
- func (t *ChanneledTransport) OnOff() <-chan struct{}
- func (t *ChanneledTransport) OnOn() <-chan struct{}
- func (t *ChanneledTransport) OnPing() <-chan struct{}
- func (t *ChanneledTransport) OnPong() <-chan struct{}
- func (t *ChanneledTransport) OnReload() <-chan Config
- func (t *ChanneledTransport) OnScaleTo() <-chan int
- func (t *ChanneledTransport) OnStart() <-chan struct{}
- func (t *ChanneledTransport) OnStop() <-chan struct{}
- func (t *ChanneledTransport) Ping() (sigSent bool)
- func (t *ChanneledTransport) Pong() (sigSent bool)
- func (t *ChanneledTransport) Reload(cfg Config) (sigSent bool)
- func (t *ChanneledTransport) ScaleTo(n int) (sigSent bool)
- func (t *ChanneledTransport) Start() (sigSent bool)
- func (t *ChanneledTransport) Stop() (sigSent bool)
- type Config
- type Freq
- type Governor
- type Orchestrator
- func (o *Orchestrator) Cfg(name string) (Config, error)
- func (o *Orchestrator) Off(name string) error
- func (o *Orchestrator) On(name string) error
- func (o *Orchestrator) Register(name string, s Service)
- func (o *Orchestrator) Reload(name string, cfg Config) error
- func (o *Orchestrator) ScaleTo(name string, n int) error
- func (o *Orchestrator) Start(name string) error
- func (o *Orchestrator) Stop()
- type Service
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanneledTransport ¶
type ChanneledTransport struct {
// contains filtered or unexported fields
}
func NewChanneledTransport ¶
func NewChanneledTransport() *ChanneledTransport
func (*ChanneledTransport) Close ¶
func (t *ChanneledTransport) Close() error
func (*ChanneledTransport) IsClosed ¶
func (t *ChanneledTransport) IsClosed() bool
func (*ChanneledTransport) Off ¶
func (t *ChanneledTransport) Off() (sigSent bool)
func (*ChanneledTransport) On ¶
func (t *ChanneledTransport) On() (sigSent bool)
func (*ChanneledTransport) OnOff ¶
func (t *ChanneledTransport) OnOff() <-chan struct{}
func (*ChanneledTransport) OnOn ¶
func (t *ChanneledTransport) OnOn() <-chan struct{}
func (*ChanneledTransport) OnPing ¶
func (t *ChanneledTransport) OnPing() <-chan struct{}
func (*ChanneledTransport) OnPong ¶
func (t *ChanneledTransport) OnPong() <-chan struct{}
func (*ChanneledTransport) OnReload ¶
func (t *ChanneledTransport) OnReload() <-chan Config
func (*ChanneledTransport) OnScaleTo ¶
func (t *ChanneledTransport) OnScaleTo() <-chan int
func (*ChanneledTransport) OnStart ¶
func (t *ChanneledTransport) OnStart() <-chan struct{}
func (*ChanneledTransport) OnStop ¶
func (t *ChanneledTransport) OnStop() <-chan struct{}
func (*ChanneledTransport) Ping ¶
func (t *ChanneledTransport) Ping() (sigSent bool)
func (*ChanneledTransport) Pong ¶
func (t *ChanneledTransport) Pong() (sigSent bool)
func (*ChanneledTransport) Reload ¶
func (t *ChanneledTransport) Reload(cfg Config) (sigSent bool)
func (*ChanneledTransport) ScaleTo ¶
func (t *ChanneledTransport) ScaleTo(n int) (sigSent bool)
func (*ChanneledTransport) Start ¶
func (t *ChanneledTransport) Start() (sigSent bool)
func (*ChanneledTransport) Stop ¶
func (t *ChanneledTransport) Stop() (sigSent bool)
type Config ¶
type Config interface {
IsEnabled() bool
SetEnabled(v bool) Config
GetReplicas() int
SetReplicas(n int) Config
GetFreq() Freq
SetFreq(freq Freq) Config
Clone() Config
}
Config is not a thread-safe structure, so it ought to be cloned before mutation.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Orchestrator
func (*Orchestrator) Off ¶
func (o *Orchestrator) Off(name string) error
func (*Orchestrator) On ¶
func (o *Orchestrator) On(name string) error
func (*Orchestrator) Register ¶
func (o *Orchestrator) Register(name string, s Service)
func (*Orchestrator) Start ¶
func (o *Orchestrator) Start(name string) error
func (*Orchestrator) Stop ¶
func (o *Orchestrator) Stop()
type Service ¶
type Service interface {
Name() string
Cfg() Config
Replicas() int
Serve(t Transport)
Transport() Transport
}
Service is implemented by a worker group (evictor, refresher, logger, ...).
type Transport ¶
type Transport interface {
Start() (sigSent bool)
Ping() (sigSent bool) // orchestrator -> ping -> worker
Pong() (sigSent bool) // worker -> pong -> orchestrator
On() (sigSent bool)
Off() (sigSent bool)
Reload(cfg Config) (sigSent bool)
ScaleTo(n int) (sigSent bool)
Stop() (sigSent bool)
IsClosed() bool
Close() error
OnStart() <-chan struct{}
OnPing() <-chan struct{}
OnPong() <-chan struct{}
OnOn() <-chan struct{}
OnOff() <-chan struct{}
OnReload() <-chan Config
OnScaleTo() <-chan int
OnStop() <-chan struct{}
}
Click to show internal directories.
Click to hide internal directories.