tcpserver

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBandwidthQuotaDuration = 1 * time.Minute

DefaultBandwidthQuotaDuration ...

View Source
var DefaultBandwidthQuotaLimit = 1000 * 1000 * 10 // 10mb

DefaultBandwidthQuotaLimit ...

View Source
var ErrInvalidQuotaDuration = fmt.Sprintf("Invalid quota duration")

ErrInvalidQuotaDuration ...

View Source
var ErrInvalidQuotaLimit = fmt.Sprintf("Invalid quota size")

ErrInvalidQuotaLimit ...

Functions

This section is empty.

Types

type BandwidthQuotaLimit

type BandwidthQuotaLimit uint64

BandwidthQuotaLimit type

func (BandwidthQuotaLimit) String

func (b BandwidthQuotaLimit) String() string

String ...

func (BandwidthQuotaLimit) Uint64

func (b BandwidthQuotaLimit) Uint64() uint64

Uint64 ...

type Config

type Config struct {
	Host                   string
	Port                   uint
	WS                     *wsserver.WS
	DB                     db.DB
	ShareBaseURL           string
	BandwidthQuotaLimit    uint64
	BandwidthQuotaDuration time.Duration
	RandomChannelLength    uint
}

Config ...

type Server

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

Server ...

func NewServer

func NewServer(config *Config) *Server

NewServer ...

func (*Server) BandwidthQuotaDuration

func (s *Server) BandwidthQuotaDuration() time.Duration

BandwidthQuotaDuration ...

func (*Server) BandwidthQuotaEnabled

func (s *Server) BandwidthQuotaEnabled() bool

BandwidthQuotaEnabled ...

func (*Server) BandwidthQuotaLimit

func (s *Server) BandwidthQuotaLimit() BandwidthQuotaLimit

BandwidthQuotaLimit ...

func (*Server) Port

func (s *Server) Port() uint

Port ...

func (*Server) Start

func (s *Server) Start() error

Start ...

Jump to

Keyboard shortcuts

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