Documentation
¶
Overview ¶
Implementation of grpc healthcheck server ¶
The server is implemented directly to allow for up to date information based on env status and for compat with broker.
Coordinator ¶
The current implementation for the ISM coordinator. The go module exports a single `Coordinator` struct, which implements the protobuf `Executor` service.
Index ¶
- type ClientContainer
- type Coordinator
- func (c *Coordinator) Check(ctx context.Context, req *health.HealthCheckRequest) (*health.HealthCheckResponse, error)
- func (c *Coordinator) EnvCheck(ctx context.Context, req *proto.EnvCheckRequest) (*proto.EnvCheckResponse, error)
- func (c *Coordinator) EnvCreate(ctx context.Context, req *proto.EnvCreateRequest) (*proto.EnvCreateResponse, error)
- func (c *Coordinator) EnvExists(ctx context.Context, req *proto.EnvStatusRequest) (*proto.EnvStatusResponse, error)
- func (c *Coordinator) EnvList(ctx context.Context, req *proto.Empty) (*proto.EnvListResponse, error)
- func (c *Coordinator) EnvStatus(ctx context.Context, req *proto.EnvStatusRequest) (*proto.EnvStatusResponse, error)
- func (c *Coordinator) Init(ctx context.Context) error
- func (c *Coordinator) List(ctx context.Context, req *health.HealthListRequest) (*health.HealthListResponse, error)
- func (c *Coordinator) Load() error
- func (c *Coordinator) LoadUpstreams(upstreams map[string]*ClientContainer) error
- func (c *Coordinator) Run(ctx context.Context, notifier util.ReadyNotifier) error
- func (c *Coordinator) SelectUpstream(subset iter.Seq[string]) *ClientContainer
- func (c *Coordinator) Stop()
- func (c *Coordinator) Ticker(ctx context.Context) error
- func (c *Coordinator) Watch(*health.HealthCheckRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientContainer ¶
aux data for upstream broker instances
func NewClientContainer ¶
func NewClientContainer(uri string, conn *grpc.ClientConn) *ClientContainer
func (*ClientContainer) SetLoadFactor ¶
func (c *ClientContainer) SetLoadFactor(loadFactor uint32)
type Coordinator ¶
type Coordinator struct {
proto.UnimplementedBrokerServiceServer // implemented in service.go
health.UnimplementedHealthServer // implemented in health.go
Listener net.Listener // listener handle
// contains filtered or unexported fields
}
current coordinator implementation container
func NewCoordinator ¶
func NewCoordinator( ctx context.Context, logger log.Logger, rcfg *api.RuntimeConfig, listener net.Listener, ) *Coordinator
func (*Coordinator) Check ¶
func (c *Coordinator) Check(ctx context.Context, req *health.HealthCheckRequest) (*health.HealthCheckResponse, error)
func (*Coordinator) EnvCheck ¶
func (c *Coordinator) EnvCheck( ctx context.Context, req *proto.EnvCheckRequest, ) (*proto.EnvCheckResponse, error)
func (*Coordinator) EnvCreate ¶
func (c *Coordinator) EnvCreate( ctx context.Context, req *proto.EnvCreateRequest, ) (*proto.EnvCreateResponse, error)
func (*Coordinator) EnvExists ¶
func (c *Coordinator) EnvExists( ctx context.Context, req *proto.EnvStatusRequest, ) (*proto.EnvStatusResponse, error)
func (*Coordinator) EnvList ¶
func (c *Coordinator) EnvList(ctx context.Context, req *proto.Empty) (*proto.EnvListResponse, error)
func (*Coordinator) EnvStatus ¶
func (c *Coordinator) EnvStatus( ctx context.Context, req *proto.EnvStatusRequest, ) (*proto.EnvStatusResponse, error)
func (*Coordinator) Init ¶
func (c *Coordinator) Init(ctx context.Context) error
initialize state of all upstreams
func (*Coordinator) List ¶
func (c *Coordinator) List(ctx context.Context, req *health.HealthListRequest) (*health.HealthListResponse, error)
func (*Coordinator) LoadUpstreams ¶
func (c *Coordinator) LoadUpstreams(upstreams map[string]*ClientContainer) error
inject custom set of upstreams, only intended for testing WARNING: will return an error, if either supplied upstreams is empty or existing upstreams are known
func (*Coordinator) Run ¶
func (c *Coordinator) Run( ctx context.Context, notifier util.ReadyNotifier, ) error
Start coordinator listener
func (*Coordinator) SelectUpstream ¶
func (c *Coordinator) SelectUpstream(subset iter.Seq[string]) *ClientContainer
SelectUpstream selects the best available upstream from subset.
func (*Coordinator) Stop ¶
func (c *Coordinator) Stop()
Stop coordinator directly (should only be used for testing)
func (*Coordinator) Ticker ¶
func (c *Coordinator) Ticker(ctx context.Context) error
background ticker for polling pool status for upstreams
func (*Coordinator) Watch ¶
func (c *Coordinator) Watch(*health.HealthCheckRequest, grpc.ServerStreamingServer[health.HealthCheckResponse]) error
Source Files
¶
- health.go
- service.go