Documentation
¶
Index ¶
- Variables
- type EndpointScheduler
- func (s *EndpointScheduler) ConfiguredEndpoints(ctx context.Context) EndpointsWithStatus
- func (s *EndpointScheduler) EndpointCount() int
- func (s *EndpointScheduler) Failover(ctx context.Context, id string) error
- func (s *EndpointScheduler) GetEndpoint(ctx context.Context, id string) *EndpointWithStatus
- func (s *EndpointScheduler) Start(ctx context.Context, endpoint models.Endpoint) (models.Endpoint, error)
- func (s *EndpointScheduler) Status(id string) string
- func (s *EndpointScheduler) Stop(ctx context.Context, id string) error
- func (s *EndpointScheduler) UpdateEndpoint(ctx context.Context, endpoint models.Endpoint) error
- type EndpointWithStatus
- type EndpointsWithStatus
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEndpointAlreadyAssigned can be sent by Start if there is another endpoint with the same election key ErrEndpointAlreadyAssigned = stderrors.New("An endpoint with the same election key already exists on that host") // ErrEndpointNotFound can be sent if an operation has been called on an unregistered Endpoint ErrEndpointNotFound = stderrors.New("Endpoint not found") )
Functions ¶
This section is empty.
Types ¶
type EndpointScheduler ¶
type EndpointScheduler struct {
// contains filtered or unexported fields
}
EndpointScheduler is LinK implementation of the Scheduler Interface
func NewEndpointScheduler ¶
func NewEndpointScheduler(config config.Config, etcd *etcdv3.Client, storage models.Storage, leaseManager locker.EtcdLeaseManager, registry plugin.Registry) *EndpointScheduler
NewEndpointScheduler creates and configures a Scheduler
func (*EndpointScheduler) ConfiguredEndpoints ¶
func (s *EndpointScheduler) ConfiguredEndpoints(ctx context.Context) EndpointsWithStatus
ConfiguredEndpoints lists all endpoints currently tracked by the scheduler
func (*EndpointScheduler) EndpointCount ¶ added in v3.1.0
func (s *EndpointScheduler) EndpointCount() int
func (*EndpointScheduler) Failover ¶
func (s *EndpointScheduler) Failover(ctx context.Context, id string) error
Failover triggers a failover on a specific endpoint
func (*EndpointScheduler) GetEndpoint ¶
func (s *EndpointScheduler) GetEndpoint(ctx context.Context, id string) *EndpointWithStatus
GetEndpoint fetches basic information about a tracked endpoint
func (*EndpointScheduler) Start ¶
func (s *EndpointScheduler) Start(ctx context.Context, endpoint models.Endpoint) (models.Endpoint, error)
Start schedules a new endpoint on the host. It launches a new manager for the endpoint and add it to the tracked endpoint on this host.
func (*EndpointScheduler) Status ¶
func (s *EndpointScheduler) Status(id string) string
Status gives you access to the state machine status of a specific endpoint
func (*EndpointScheduler) Stop ¶
func (s *EndpointScheduler) Stop(ctx context.Context, id string) error
Stop the manager of the specified endpoint and remove it from the tracked endpoints
func (*EndpointScheduler) UpdateEndpoint ¶
UpdateEndpoint updates the endpoint in the scheduler storage, and the health checks in the endpoint manager.
type EndpointWithStatus ¶
func (EndpointWithStatus) ToAPIType ¶
func (e EndpointWithStatus) ToAPIType() api.Endpoint
type EndpointsWithStatus ¶
type EndpointsWithStatus []EndpointWithStatus
func (EndpointsWithStatus) ToAPIType ¶
func (e EndpointsWithStatus) ToAPIType() []api.Endpoint
type Scheduler ¶
type Scheduler interface {
Start(ctx context.Context, endpoint models.Endpoint) (models.Endpoint, error)
Stop(ctx context.Context, id string) error
Failover(ctx context.Context, id string) error
Status(id string) string
ConfiguredEndpoints(ctx context.Context) EndpointsWithStatus
GetEndpoint(ctx context.Context, id string) *EndpointWithStatus
EndpointCount() int
UpdateEndpoint(ctx context.Context, endpoint models.Endpoint) error
}
Scheduler is the central point of LinK it will keep track all of endpoints registered on this node however the heavy lifting for a single endpoint is done in the Manager
Directories
¶
| Path | Synopsis |
|---|---|
|
Package schedulermock is a generated GoMock package.
|
Package schedulermock is a generated GoMock package. |