rpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*RPC)

func WithLogger

func WithLogger(logger *logrus.Logger) Option

type RPC

type RPC struct {
	api.UnimplementedCirrusCIServiceServer
	// contains filtered or unexported fields
}

func New

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

func (*RPC) ClientSecret

func (r *RPC) ClientSecret() string

func (*RPC) Endpoint

func (r *RPC) Endpoint() string

Endpoint returns RPC server address suitable for use in agent's "-api-endpoint" flag.

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) 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) ReportSingleCommand

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

func (*RPC) ServerSecret

func (r *RPC) ServerSecret() string

func (*RPC) Start

func (r *RPC) Start()

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

Jump to

Keyboard shortcuts

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