rpc

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRPCFailed = errors.New("RPC server failed")

Functions

This section is empty.

Types

type Option

type Option func(*RPC)

func WithLogger

func WithLogger(logger *echelon.Logger) Option

type RPC

type RPC struct {
	// must be embedded to have forward compatible implementations
	api.UnimplementedCirrusCIServiceServer
	// contains filtered or unexported fields
}

func New

func New(build *build.Build, opts ...Option) *RPC

func (*RPC) CacheInfo added in v0.3.0

func (r *RPC) CacheInfo(ctx context.Context, req *api.CacheInfoRequest) (*api.CacheInfoResponse, error)

func (*RPC) ClientSecret

func (r *RPC) ClientSecret() string

func (*RPC) ContainerEndpoint added in v0.16.0

func (r *RPC) ContainerEndpoint() string

ContainerEndpoint returns RPC server address suitable for use in agent's "-api-endpoint" flag when running inside of a container.

func (*RPC) DirectEndpoint added in v0.16.0

func (r *RPC) DirectEndpoint() string

DirectEndpoint returns RPC server address suitable for use in agent's "-api-endpoint" flag when running on the host.

func (*RPC) DownloadCache added in v0.3.0

func (*RPC) Heartbeat

func (r *RPC) Heartbeat(ctx context.Context, req *api.HeartbeatRequest) (*api.HeartbeatResponse, error)

func (*RPC) InitialCommands

func (r *RPC) InitialCommands(
	ctx context.Context,
	req *api.InitialCommandsRequest,
) (*api.CommandsResponse, error)

func (*RPC) ReportAgentError

func (r *RPC) ReportAgentError(ctx context.Context, req *api.ReportAgentProblemRequest) (*empty.Empty, error)

func (*RPC) ReportAgentLogs added in v0.3.0

func (r *RPC) ReportAgentLogs(ctx context.Context, req *api.ReportAgentLogsRequest) (*empty.Empty, error)

func (*RPC) ReportAgentSignal

func (r *RPC) ReportAgentSignal(ctx context.Context, req *api.ReportAgentSignalRequest) (*empty.Empty, error)

func (*RPC) ReportAgentWarning

func (r *RPC) ReportAgentWarning(ctx context.Context, req *api.ReportAgentProblemRequest) (*empty.Empty, error)

func (*RPC) ReportAnnotations added in v0.3.0

func (r *RPC) ReportAnnotations(ctx context.Context, req *api.ReportAnnotationsCommandRequest) (*empty.Empty, error)

func (*RPC) ReportSingleCommand

func (r *RPC) ReportSingleCommand(
	ctx context.Context,
	req *api.ReportSingleCommandRequest,
) (*api.ReportSingleCommandResponse, error)

func (*RPC) SaveLogs added in v0.3.0

func (r *RPC) SaveLogs(stream api.CirrusCIService_SaveLogsServer) error

func (*RPC) ServerSecret

func (r *RPC) ServerSecret() string

func (*RPC) Start

func (r *RPC) Start(ctx context.Context, address string) error

Start creates the listener and starts RPC server in a separate goroutine.

func (*RPC) Stop

func (r *RPC) Stop()

Stop gracefully stops the RPC server.

func (*RPC) StreamLogs

func (r *RPC) StreamLogs(stream api.CirrusCIService_StreamLogsServer) error

func (*RPC) UploadArtifacts added in v0.3.0

func (r *RPC) UploadArtifacts(stream api.CirrusCIService_UploadArtifactsServer) error

func (*RPC) UploadCache added in v0.3.0

func (r *RPC) UploadCache(stream api.CirrusCIService_UploadCacheServer) error

Jump to

Keyboard shortcuts

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