probe

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndRunGRPCHealthProbe

func CreateAndRunGRPCHealthProbe(ctx context.Context, healthService string, options ...Option)

CreateAndRunGRPCHealthProbe - Creates and runs a gRPC health probe client and registers the status response of the service to a local gRPC health server retrived from the context. In the local health server the service is refered to by healthService string.

Types

type HealthProbe added in v1.0.13

type HealthProbe struct {
	// contains filtered or unexported fields
}

func NewHealthProbe added in v1.0.13

func NewHealthProbe(ctx context.Context, options ...Option) (*HealthProbe, error)

NewHealthProbe - Create a new grpc health probe which is an alternate to grpc-health-probe binary but does NOT require a new process to get spawned. Thus, when using with the spiffe option the spire agents are not required to attest new processes all the time when the probe is invoked.

func (*HealthProbe) Request added in v1.0.13

func (hp *HealthProbe) Request(ctx context.Context) error

Request - Sends query to check health of gRPC services exposing their status through gRPC Health Checking Protocol.

Returns no error if queried service is SERVING.

func (*HealthProbe) String added in v1.0.13

func (hp *HealthProbe) String() string

String -

type Option

type Option func(o *probeOptions)

func WithAddress

func WithAddress(addr string) Option

WithAddress sets address for probe

func WithConnectTimeout

func WithConnectTimeout(connTimeout time.Duration) Option

WithConnectTimeout sests connect timeout probe

func WithRPCTimeout

func WithRPCTimeout(rpcTimeout time.Duration) Option

WithRPCTimeout sets RPC timeout for probe

func WithService

func WithService(service string) Option

WithService sets service for probe

func WithSpiffe

func WithSpiffe() Option

WithSpiffe sets spiffe option for probe

func WithUserAgent added in v1.0.13

func WithUserAgent(userAgent string) Option

WithUserAgent sests user agent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL