client

package
v2.47.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 18 Imported by: 1 module, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultChunkSize = 4 * 1024
)

Variables

View Source
var (
	ErrDownloadHeaderUnexpectedNumber = &backoff.PermanentError{Err: status.Error(codes.DataLoss, "unexpected number of headers")}
	ErrDownloadChecksumMismatch       = &backoff.PermanentError{Err: status.Error(codes.DataLoss, "download checksum mismatch")}
	ErrDownloadDataChunkNoData        = &backoff.PermanentError{Err: status.Error(codes.DataLoss, "download DataChunk without data")}
	ErrUnmarshallingData              = &backoff.PermanentError{Err: status.Error(codes.DataLoss, "unable to unmarshal data")}
)
View Source
var DefaultBackoffSettings = backoff.BackoffSettings{
	InitialInterval: 100 * time.Millisecond,
	MaxInterval:     1 * time.Minute,
	MaxElapsedTime:  0,
	Jitter:          backoff.BACKOFF_JITTER,
	Multiplier:      backoff.BACKOFF_MULTIPLIER,
}

Functions

This section is empty.

Types

type Client

type Client interface {
	Connect(ctx context.Context) error
	Close() error

	Server() string
	WithServer(string) Client

	DialOptions() []grpc.DialOption
	WithDialOptions(options ...grpc.DialOption) Client

	WithInterceptor(interceptor interceptors.Interceptor) Client
	WithClientInterceptor(interceptor interceptors.ClientInterceptor) Client

	WithBackoffSettings(backoffSettings backoff.BackoffSettings) Client
}

type Commander

type Commander interface {
	Client
	ChunksSize() int
	WithChunkSize(int) Client
	Send(context.Context, Message) error
	Download(context.Context, *proto.Metadata) (*proto.NginxConfig, error)
	Upload(context.Context, *proto.NginxConfig, string) error
	Recv() <-chan Message
}

func NewCommanderClient

func NewCommanderClient() Commander

type Controller

type Controller interface {
	WithClient(Client) Controller
	Context() context.Context
	WithContext(context.Context) Controller
	Connect()
	Close() error
}

func NewClientController

func NewClientController() Controller

type Message

type Message interface {
	Meta() *proto.Metadata
	Type() MsgType
	Classification() MsgClassification
	Data() interface{}
	Raw() interface{}
}

func MessageFromCommand

func MessageFromCommand(cmd *proto.Command) Message

func MessageFromEvents added in v2.20.0

func MessageFromEvents(event *models.EventReport) Message

func MessageFromMetrics

func MessageFromMetrics(metric *proto.MetricsReport) Message

type MetricReporter

type MetricReporter interface {
	Client
	Send(context.Context, Message) error
}

func NewMetricReporterClient

func NewMetricReporterClient() MetricReporter

type MsgClassification

type MsgClassification int
const (
	MsgClassificationCommand MsgClassification = iota
	MsgClassificationMetric
	MsgClassificationEvent
)

type MsgType

type MsgType interface {
	String() string
	EnumDescriptor() ([]byte, []int)
}

Jump to

Keyboard shortcuts

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