workerapi

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer func(ctx context.Context, endpoint string) bool

Authorizer decides whether a worker API request is authorized.

func BearerTokenAuthorizer

func BearerTokenAuthorizer(tokens [][]byte) Authorizer

BearerTokenAuthorizer validates gRPC metadata Authorization headers. Expected format: "Authorization: Bearer <token>".

type Server

type Server struct {
	workerapipb.UnimplementedWorkerServiceServer

	Pull          *pullapi.Server
	ResolveRoute  func(endpoint string) (route string, ok bool)
	Authorize     Authorizer
	MaxLeaseBatch int
}

Server exposes the optional worker gRPC transport while reusing pull semantics.

func NewServer

func NewServer(pullServer *pullapi.Server) *Server

func (*Server) Ack

func (*Server) Dequeue

func (*Server) Extend

func (s *Server) Extend(ctx context.Context, req *workerapipb.ExtendRequest) (*emptypb.Empty, error)

func (*Server) Nack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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