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 MessageFromEvents ¶ added in v2.20.0
func MessageFromEvents(event *models.EventReport) Message
func MessageFromMetrics ¶
func MessageFromMetrics(metric *proto.MetricsReport) Message
type MetricReporter ¶
func NewMetricReporterClient ¶
func NewMetricReporterClient() MetricReporter
type MsgClassification ¶
type MsgClassification int
const ( MsgClassificationCommand MsgClassification = iota MsgClassificationMetric MsgClassificationEvent )
Click to show internal directories.
Click to hide internal directories.