client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnhandledError error = errors.New("an unhandled gRPC error occurred")

Functions

func WithPreSharedKey

func WithPreSharedKey(key string) grpc.DialOption

Types

type Client

type Client interface {
	io.Closer
	Connect(ctx context.Context) error
	Check(ctx context.Context, model string, as string) (bool, error)
	Push(ctx context.Context, model string, from graph.Source, as string) error
	Pull(ctx context.Context, model string, to graph.Destination, as string) error
}

func New

func New(ctx context.Context, target string, opt ...ClientOption) (Client, error)

type ClientOption

type ClientOption func(c *client) error

func WithDialOptions

func WithDialOptions(opt ...grpc.DialOption) ClientOption

func WithMetrics

func WithMetrics(reg prometheus.Registerer) ClientOption

func WithPeerName

func WithPeerName(name string) ClientOption

func WithTLS

func WithTLS(config *tls.Config) ClientOption

type MetricsCollector

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

func (*MetricsCollector) For

type RequestMetricsCollector

type RequestMetricsCollector interface {
	Erred()
	Pushed()
	Pulled()
	Acknowledged()
}

Jump to

Keyboard shortcuts

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