rpcserver

package
v2.0.2-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultListenPort is the default port cdn server listens on.
	DefaultListenPort = 8003
	// DefaultDownloadPort is the default port for download files from cdn.
	DefaultDownloadPort = 8001
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v2.0.2

type Config struct {

	// AdvertiseIP is used to set the ip that we advertise to other peer in the p2p-network.
	// By default, the first non-loop address is advertised.
	AdvertiseIP string `yaml:"advertiseIP" mapstructure:"advertiseIP"`

	// ListenPort is the port cdn server listens on.
	// default: 8002
	ListenPort int `yaml:"listenPort" mapstructure:"listenPort"`

	// DownloadPort is the port for download files from cdn.
	// default: 8001
	DownloadPort int `yaml:"downloadPort" mapstructure:"downloadPort"`
}

func DefaultConfig added in v2.0.2

func DefaultConfig() Config

func (Config) Validate added in v2.0.2

func (c Config) Validate() []error

type Server added in v2.0.2

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

func New added in v2.0.1

func New(config Config, cdnService supervisor.CDNService, opts ...grpc.ServerOption) (*Server, error)

New returns a new Manager Object.

func (*Server) GetConfig added in v2.0.2

func (css *Server) GetConfig() Config

func (*Server) GetPieceTasks added in v2.0.2

func (css *Server) GetPieceTasks(ctx context.Context, req *base.PieceTaskRequest) (piecePacket *base.PiecePacket, err error)

func (*Server) ListenAndServe added in v2.0.2

func (css *Server) ListenAndServe() error

func (*Server) ObtainSeeds added in v2.0.2

func (css *Server) ObtainSeeds(ctx context.Context, req *cdnsystem.SeedRequest, psc chan<- *cdnsystem.PieceSeed) (err error)

func (*Server) Shutdown added in v2.0.2

func (css *Server) Shutdown() error

Jump to

Keyboard shortcuts

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