Documentation ¶
Index ¶
- func ConvertToConsulCheck(probe *corev1.Probe, host string) *consul.Check
- func Find(slice []string, val string) bool
- type Client
- type ServiceProvider
- func (p *ServiceProvider) CheckProbe(ctx context.Context) error
- func (p *ServiceProvider) GenerateSecured(ctx context.Context, services []consul.ServiceInstance) []consul.ServiceInstance
- func (p *ServiceProvider) Get(ctx context.Context) ([]consul.ServiceInstance, error)
- func (p *ServiceProvider) IsPodTerminating(ctx context.Context) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToConsulCheck ¶
ConvertToConsulCheck converts Kubernetes probe definition to Consul check definition.
Types ¶
type Client ¶
type Client interface { // GetPod returns current pod data. GetPod(ctx context.Context, podNamespace string, podName string) (*corev1.Pod, error) // GetFailureDomainTags returns current failure domain for pod GetFailureDomainTags(ctx context.Context, pod *corev1.Pod) ([]string, error) // DoProbeCheck check if service is alive DoProbeCheck(pod *corev1.Probe, ip string) error }
Client is an interface for client to Kubernetes API.
type ServiceProvider ¶
type ServiceProvider struct { Client Client Timeout time.Duration HealthCheckTimeout time.Duration }
ServiceProvider is responsible for providing services that should be registered in Consul discovery service.
func (*ServiceProvider) CheckProbe ¶ added in v0.2.3
func (p *ServiceProvider) CheckProbe(ctx context.Context) error
func (*ServiceProvider) GenerateSecured ¶ added in v0.1.30
func (p *ServiceProvider) GenerateSecured(ctx context.Context, services []consul.ServiceInstance) []consul.ServiceInstance
GenerateSecured generates list of postfixed Consul services for deregistration
func (*ServiceProvider) Get ¶
func (p *ServiceProvider) Get(ctx context.Context) ([]consul.ServiceInstance, error)
Get returns slice of services that are configured to be registered in Consul discovery service.
func (*ServiceProvider) IsPodTerminating ¶ added in v0.2.9
func (p *ServiceProvider) IsPodTerminating(ctx context.Context) (bool, error)
Click to show internal directories.
Click to hide internal directories.