modshared

package
v14.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoAgentId int64 = 0
)

Variables

View Source
var File_internal_module_modshared_modshared_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AgentMeta

type AgentMeta struct {
	Version      string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	CommitId     string `protobuf:"bytes,2,opt,name=commit_id,proto3" json:"commit_id,omitempty"`
	PodNamespace string `protobuf:"bytes,3,opt,name=pod_namespace,proto3" json:"pod_namespace,omitempty"`
	PodName      string `protobuf:"bytes,4,opt,name=pod_name,proto3" json:"pod_name,omitempty"`
	// contains filtered or unexported fields
}

func (*AgentMeta) Descriptor deprecated

func (*AgentMeta) Descriptor() ([]byte, []int)

Deprecated: Use AgentMeta.ProtoReflect.Descriptor instead.

func (*AgentMeta) GetCommitId

func (x *AgentMeta) GetCommitId() string

func (*AgentMeta) GetPodName

func (x *AgentMeta) GetPodName() string

func (*AgentMeta) GetPodNamespace

func (x *AgentMeta) GetPodNamespace() string

func (*AgentMeta) GetVersion

func (x *AgentMeta) GetVersion() string

func (*AgentMeta) ProtoMessage

func (*AgentMeta) ProtoMessage()

func (*AgentMeta) ProtoReflect

func (x *AgentMeta) ProtoReflect() protoreflect.Message

func (*AgentMeta) Reset

func (x *AgentMeta) Reset()

func (*AgentMeta) String

func (x *AgentMeta) String() string

type Api added in v14.2.0

type Api interface {
	// HandleProcessingError can be used to handle errors occurring while processing a request.
	// If err is a (or wraps a) errz.UserError, it might be handled specially.
	HandleProcessingError(ctx context.Context, log *zap.Logger, agentId int64, msg string, err error)
}

Api provides the API for the module to use.

type RpcApi added in v14.2.0

type RpcApi interface {
	// Log returns a logger to use in the context of the request being processed.
	Log() *zap.Logger
	// HandleProcessingError can be used to handle errors occurring while processing a request.
	// If err is a (or wraps a) errz.UserError, it might be handled specially.
	HandleProcessingError(log *zap.Logger, agentId int64, msg string, err error)
	// HandleSendError can be used to handle error produced by gRPC Send() or SendMsg() method.
	// It returns an error, compatible with gRPC status package.
	HandleSendError(log *zap.Logger, msg string, err error) error
	// PollWithBackoff runs f every duration given by BackoffManager.
	//
	// PollWithBackoff should be used by the top-level polling, so that it can be gracefully interrupted
	// by the server when necessary. E.g. when stream is nearing it's max connection age or program needs to
	// be shut down.
	// If sliding is true, the period is computed after f runs. If it is false then
	// period includes the runtime for f.
	// It returns when:
	// - stream's context is cancelled or max connection age has been reached. nil is returned in this case.
	// - f returns Done. error from f is returned in this case.
	PollWithBackoff(cfg retry.PollConfig, f retry.PollWithBackoffFunc) error
}

RpcApi provides the API for the module's gRPC handlers to use.

type RpcApiStub added in v14.2.0

type RpcApiStub struct {
	StreamCtx context.Context
	Logger    *zap.Logger
}

func (*RpcApiStub) Log added in v14.2.0

func (a *RpcApiStub) Log() *zap.Logger

func (*RpcApiStub) PollWithBackoff added in v14.2.0

func (a *RpcApiStub) PollWithBackoff(cfg retry.PollConfig, f retry.PollWithBackoffFunc) error

Jump to

Keyboard shortcuts

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