worker

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrWorker   = errors.New("worker failed")
	ErrShutdown = errors.New("worker is shutting down")
)

Functions

This section is empty.

Types

type Option

type Option func(*Worker)

func WithAgentEndpoint added in v0.71.4

func WithAgentEndpoint(agentEndpoint endpoint.Endpoint) Option

func WithLabels

func WithLabels(labels map[string]string) Option

func WithLogger added in v0.30.0

func WithLogger(logger logrus.FieldLogger) Option

func WithName

func WithName(name string) Option

func WithRPCEndpoint

func WithRPCEndpoint(rpcEndpoint string) Option

func WithRegistrationToken

func WithRegistrationToken(registrationToken string) Option

func WithResources added in v0.79.0

func WithResources(resources map[string]float64) Option

type Worker

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

func New

func New(opts ...Option) (*Worker, error)

func (*Worker) GetRequestMetadata

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

PerRPCCredentials interface implementation.

func (*Worker) Pause added in v0.77.0

func (worker *Worker) Pause(ctx context.Context, wait bool) error

func (*Worker) RequireTransportSecurity

func (worker *Worker) RequireTransportSecurity() bool

PerRPCCredentials interface implementation.

func (*Worker) Resume added in v0.77.0

func (worker *Worker) Resume(ctx context.Context) error

func (*Worker) Run

func (worker *Worker) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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