server

package
v0.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 19 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(p *SchedulerServer) *SchedulerServer

Option is a functional option for configuring the scheduler

func WithSchedulerService

func WithSchedulerService(service *service.SchedulerService) Option

WithSchedulerService sets the *service.SchedulerService

func WithWorker

func WithWorker(worker worker.IWorker) Option

WithWorker sets the worker.IWorker

type SchedulerServer

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

func NewSchedulerServer

func NewSchedulerServer(cfg *config.Config, options ...Option) *SchedulerServer

NewSchedulerServer returns a new transparent scheduler server from the given options

func NewSchedulerWithOptions

func NewSchedulerWithOptions(cfg *config.Config, options ...Option) *SchedulerServer

NewSchedulerWithOptions constructs a new instance of a scheduler server with additional options.

func (*SchedulerServer) LeaveTask

func (s *SchedulerServer) LeaveTask(ctx context.Context, target *scheduler.PeerTarget) (err error)

func (*SchedulerServer) RegisterPeerTask

func (s *SchedulerServer) RegisterPeerTask(ctx context.Context, request *scheduler.PeerTaskRequest) (pkg *scheduler.RegisterResult, err error)

func (*SchedulerServer) ReportPeerResult

func (s *SchedulerServer) ReportPeerResult(ctx context.Context, result *scheduler.PeerResult) (err error)

func (*SchedulerServer) ReportPieceResult

func (s *SchedulerServer) ReportPieceResult(stream scheduler.Scheduler_ReportPieceResultServer) (err error)

type Server

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

func New

func New(cfg *config.Config) (*Server, error)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) Stop

func (s *Server) Stop() (err error)

Jump to

Keyboard shortcuts

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