Documentation ¶
Index ¶
- Variables
- func Check(ctx context.Context, instances []Instance) (response []*ph.HealthCheckResponse, status ph.Status)
- func GetHealthWithDuration(ctx context.Context, instance Instance) *ph.HealthCheckResponse
- func ProviderList() []string
- func Register(name string, provider Instance)
- type Config
- type Instance
- type ProviderRegistry
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Providers = ProviderRegistry{}
)
Providers is a map of provider names to their types, used for registering providers.
Functions ¶
func GetHealthWithDuration ¶
func GetHealthWithDuration(ctx context.Context, instance Instance) *ph.HealthCheckResponse
Types ¶
type Config ¶
type Config interface {
GetInstances() []Instance
}
Config is the interface through which the provider configuration is retrieved.
type Instance ¶
type Instance interface { // GetType returns the provider type of the instance GetType() string // GetName returns the name of the instance GetName() string // GetHealth checks and returns the instance GetHealth(context.Context) *ph.HealthCheckResponse // SetDefaults sets the default values for the instance SetDefaults() }
Instance is the interface that must be implemented by all providers.
type ProviderRegistry ¶
Click to show internal directories.
Click to hide internal directories.