rpc

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 24 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 ArtifactWriter added in v0.80.0

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

func NewArtifactWriter added in v0.80.0

func NewArtifactWriter(baseDir string) *ArtifactWriter

func (*ArtifactWriter) Close added in v0.80.0

func (aw *ArtifactWriter) Close() error

func (*ArtifactWriter) WriteTo added in v0.80.0

func (aw *ArtifactWriter) WriteTo(name string, b []byte) (int, error)

type Option

type Option func(*RPC)

func WithArtifactsDir added in v0.80.0

func WithArtifactsDir(artifactsDir string) Option

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) ReportAgentFinished added in v0.71.0

func (r *RPC) ReportAgentFinished(
	ctx context.Context,
	req *api.ReportAgentFinishedRequest,
) (*api.ReportAgentFinishedResponse, 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) ReportCommandUpdates added in v0.71.0

func (r *RPC) ReportCommandUpdates(
	ctx context.Context,
	req *api.ReportCommandUpdatesRequest,
) (*api.ReportCommandUpdatesResponse, 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, virtualMachine bool) 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) (err 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