Documentation ¶
Index ¶
- Constants
- type Config
- type Server
- func (css *Server) GetConfig() Config
- func (css *Server) GetPieceTasks(ctx context.Context, req *base.PieceTaskRequest) (piecePacket *base.PiecePacket, err error)
- func (css *Server) ListenAndServe() error
- func (css *Server) ObtainSeeds(ctx context.Context, req *cdnsystem.SeedRequest, ...) (err error)
- func (css *Server) Shutdown() error
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
type Server ¶ added in v2.0.2
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) 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 (*Server) ObtainSeeds ¶ added in v2.0.2
Click to show internal directories.
Click to hide internal directories.