Documentation ¶
Index ¶
- Variables
- type IPScheduler
- func (s *IPScheduler) ConfiguredIPs(ctx context.Context) []api.IP
- func (s *IPScheduler) Failover(ctx context.Context, id string) error
- func (s *IPScheduler) GetIP(ctx context.Context, id string) *api.IP
- func (s *IPScheduler) Start(ctx context.Context, ipAddr models.IP) (models.IP, error)
- func (s *IPScheduler) Status(id string) string
- func (s *IPScheduler) Stop(ctx context.Context, id string) error
- func (s *IPScheduler) UpdateIP(ctx context.Context, ip models.IP) error
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrIPAlreadyAssigned can be sent by AddIP if the IP has already been assigned to this scheduler ErrIPAlreadyAssigned = errors.New("IP already assigned") // ErrIPNotFound can be sent if an operation has been called on an unregistered IP ErrIPNotFound = errors.New("IP not found") )
Functions ¶
This section is empty.
Types ¶
type IPScheduler ¶
type IPScheduler struct {
// contains filtered or unexported fields
}
IPScheduler is LinK implementation of the Scheduler Interface
func NewIPScheduler ¶
func NewIPScheduler(config config.Config, etcd *clientv3.Client, storage models.Storage, leaseManager locker.EtcdLeaseManager) *IPScheduler
NewIPScheduler creates and configures a Scheduler
func (*IPScheduler) ConfiguredIPs ¶
func (s *IPScheduler) ConfiguredIPs(ctx context.Context) []api.IP
ConfiguredIPs lists all IPs currently tracked by the scheduler
func (*IPScheduler) Failover ¶
func (s *IPScheduler) Failover(ctx context.Context, id string) error
Failover triggers a failover on a specific IP
func (*IPScheduler) Start ¶
Start schedules a new IP on the host. It launches a new manager for the IP and add it to the tracked IP on this host.
func (*IPScheduler) Status ¶
func (s *IPScheduler) Status(id string) string
Status gives you access to the state machine status of a specific IP
type Scheduler ¶
type Scheduler interface { Start(context.Context, models.IP) (models.IP, error) Stop(ctx context.Context, id string) error Failover(ctx context.Context, id string) error Status(string) string ConfiguredIPs(ctx context.Context) []api.IP GetIP(ctx context.Context, id string) *api.IP UpdateIP(context.Context, models.IP) error }
Scheduler is the central point of LinK it will keep track all of IPs registered on this node however the heavy lifting for a single IP is done in the Manager
Directories ¶
Path | Synopsis |
---|---|
Package schedulermock is a generated GoMock package.
|
Package schedulermock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.