Documentation ¶
Index ¶
- func AnalyzeHealthStats(healthData *fegprotos.HealthStats, networkID string) (fegprotos.HealthStatus_HealthState, string, error)
- func GetHealthConfigForNetwork(networkID string) *healthConfig
- type HealthServer
- func (srv *HealthServer) GetClusterState(ctx context.Context, req *fegprotos.ClusterStateRequest) (*fegprotos.ClusterState, error)
- func (srv *HealthServer) GetHealth(ctx context.Context, req *fegprotos.GatewayStatusRequest) (*fegprotos.HealthStats, error)
- func (srv *HealthServer) UpdateHealth(ctx context.Context, req *fegprotos.HealthRequest) (*fegprotos.HealthResponse, error)
- type HealthStatus
- type TestHealthServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeHealthStats ¶
func AnalyzeHealthStats( healthData *fegprotos.HealthStats, networkID string, ) (fegprotos.HealthStatus_HealthState, string, error)
AnalyzeHealthStats takes a HealthStats proto and determines if it is HEALTHY or UNHEALTHY based on the configuration for the provided networkID
func GetHealthConfigForNetwork ¶
func GetHealthConfigForNetwork(networkID string) *healthConfig
Types ¶
type HealthServer ¶
type HealthServer struct {
// contains filtered or unexported fields
}
func NewHealthServer ¶
func NewHealthServer(factory blobstore.BlobStorageFactory) (*HealthServer, error)
func (*HealthServer) GetClusterState ¶
func (srv *HealthServer) GetClusterState(ctx context.Context, req *fegprotos.ClusterStateRequest) (*fegprotos.ClusterState, error)
GetClusterState takes a ClusterStateRequest containing a networkID and clusterID and returns the ClusterState or an error
func (*HealthServer) GetHealth ¶
func (srv *HealthServer) GetHealth(ctx context.Context, req *fegprotos.GatewayStatusRequest) (*fegprotos.HealthStats, error)
GetHealth fetches the health stats for a given gateway represented by a (networkID, logicalId)
func (*HealthServer) UpdateHealth ¶
func (srv *HealthServer) UpdateHealth(ctx context.Context, req *fegprotos.HealthRequest) (*fegprotos.HealthResponse, error)
type HealthStatus ¶
type HealthStatus int
type TestHealthServer ¶
type TestHealthServer struct { HealthServer Feg1 bool //boolean to simulate requests coming from more than 1 FeG }
A little Go "polymorphism" magic for testing
func NewTestHealthServer ¶
func NewTestHealthServer(mockFactory blobstore.BlobStorageFactory) (*TestHealthServer, error)
func (*TestHealthServer) UpdateHealth ¶
func (srv *TestHealthServer) UpdateHealth( ctx context.Context, req *fegprotos.HealthRequest, ) (*fegprotos.HealthResponse, error)
Health receiver for testHealthServer injects GW Identity into CTX if it's missing for testing without heavy mock of Certifier & certificate addition
Click to show internal directories.
Click to hide internal directories.