health

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMaterializerRequest added in v1.13.0

func NewMaterializerRequest(srvReq structs.ServiceSpecificRequest) func(index uint64) *pbsubscribe.SubscribeRequest

Types

type CacheGetter

type CacheGetter interface {
	Get(ctx context.Context, t string, r cache.Request) (interface{}, cache.ResultMeta, error)
	NotifyCallback(ctx context.Context, t string, r cache.Request, cID string, cb cache.Callback) error
}

type Client

type Client struct {
	NetRPC              NetRPC
	Cache               CacheGetter
	ViewStore           MaterializedViewStore
	MaterializerDeps    MaterializerDeps
	CacheName           string
	UseStreamingBackend bool
	QueryOptionDefaults func(options *structs.QueryOptions)
}

Client provides access to service health data.

func (*Client) Close added in v1.10.0

func (c *Client) Close() error

Close any underlying connections used by the client.

func (*Client) IsReadyForStreaming added in v1.12.7

func (c *Client) IsReadyForStreaming() bool

IsReadyForStreaming will indicate if the underlying gRPC connection is ready.

func (*Client) Notify added in v1.10.0

func (c *Client) Notify(
	ctx context.Context,
	req structs.ServiceSpecificRequest,
	correlationID string,
	cb cache.Callback,
) error

type HealthView added in v1.13.0

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

HealthView implements submatview.View for storing the view state of a service health result. We store it as a map to make updates and deletions a little easier but we could just store a result type (IndexedCheckServiceNodes) and update it in place for each event - that involves re-sorting each time etc. though.

func NewHealthView added in v1.13.0

func NewHealthView(req structs.ServiceSpecificRequest) (*HealthView, error)

func (*HealthView) Reset added in v1.13.0

func (s *HealthView) Reset()

func (*HealthView) Result added in v1.13.0

func (s *HealthView) Result(index uint64) interface{}

Result returns the structs.IndexedCheckServiceNodes stored by this view.

func (*HealthView) Update added in v1.13.0

func (s *HealthView) Update(events []*pbsubscribe.Event) error

Update implements View

type MaterializedViewStore added in v1.10.0

type MaterializedViewStore interface {
	Get(ctx context.Context, req submatview.Request) (submatview.Result, error)
	NotifyCallback(ctx context.Context, req submatview.Request, cID string, cb cache.Callback) error
}

type MaterializerDeps added in v1.10.0

type MaterializerDeps struct {
	Conn   *grpc.ClientConn
	Logger hclog.Logger
}

type NetRPC

type NetRPC interface {
	RPC(ctx context.Context, method string, args interface{}, reply interface{}) error
}

Jump to

Keyboard shortcuts

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