upstream

package
v0.122.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPCEndpoint = "https://grpc.cirrus-ci.com:443"
)

Variables

View Source
var (
	ErrFailed = errors.New("upstream failed")
)

Functions

This section is empty.

Types

type Option

type Option func(*Upstream)

func WithAgentEndpoint

func WithAgentEndpoint(agentEndpoint endpoint.Endpoint) Option

func WithLogger

func WithLogger(logger logrus.FieldLogger) Option

func WithRPCEndpoint

func WithRPCEndpoint(rpcEndpoint string) Option

type Upstream

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

func New

func New(workerName string, registrationToken string, opts ...Option) (*Upstream, error)

func (*Upstream) AgentEndpoint

func (upstream *Upstream) AgentEndpoint() endpoint.Endpoint

func (*Upstream) Connect

func (upstream *Upstream) Connect(ctx context.Context) error

func (*Upstream) GetRequestMetadata

func (upstream *Upstream) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

PerRPCCredentials interface implementation.

func (*Upstream) Name

func (upstream *Upstream) Name() string

func (*Upstream) Poll

func (upstream *Upstream) Poll(ctx context.Context, request *api.PollRequest) (*api.PollResponse, error)

func (*Upstream) PollIntervalSeconds

func (upstream *Upstream) PollIntervalSeconds() uint32

func (*Upstream) QueryRunningTasks

func (upstream *Upstream) QueryRunningTasks(
	ctx context.Context,
	request *api.QueryRunningTasksRequest,
) (*api.QueryRunningTasksResponse, error)

func (*Upstream) Register

func (upstream *Upstream) Register(ctx context.Context, workerInfo *api.WorkerInfo) error

func (*Upstream) RequireTransportSecurity

func (upstream *Upstream) RequireTransportSecurity() bool

PerRPCCredentials interface implementation.

func (*Upstream) SetDisabled

func (upstream *Upstream) SetDisabled(ctx context.Context, disabled bool) error

func (*Upstream) TaskFailed

func (upstream *Upstream) TaskFailed(ctx context.Context, request *api.TaskFailedRequest) error

func (*Upstream) TaskStarted

func (upstream *Upstream) TaskStarted(ctx context.Context, request *api.TaskIdentification) error

func (*Upstream) TaskStopped

func (upstream *Upstream) TaskStopped(ctx context.Context, request *api.TaskIdentification) error

func (*Upstream) WorkerName

func (upstream *Upstream) WorkerName() string

Jump to

Keyboard shortcuts

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