server

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ip string, port int, cert string, key string, debug bool, t *Tracker, m *autocert.Manager, tor bool) (err error)

Start brings up the TCP server.

func StartStatsServer added in v0.1.1

func StartStatsServer(ip string, port int, cert string, key string, si StatsInformer, m *autocert.Manager, tor bool) error

StartStatsServer creates a new server to serve stats

func StartWebsocket added in v0.4.0

func StartWebsocket(ip string, port int, cert string, key string, debug bool, t *Tracker, m *autocert.Manager, tor bool) (err error)

StartWebsocket brings up the websocket server.

Types

type PoolStats added in v0.1.1

type PoolStats struct {
	Members int    `json:"members"`
	Amount  uint64 `json:"amount"`
	Type    string `json:"type"`
	Full    bool   `json:"full"`
	Version uint64 `json:"version"`
}

PoolStats represents the stats for a particular pool

type StatsInformer added in v0.1.1

type StatsInformer interface {
	Stats(string, bool) *TrackerStats
}

StatsInformer defines an interface that exposes tracker stats

type Tracker added in v0.2.0

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

Tracker is used to track connections to the server.

func NewTracker added in v0.1.1

func NewTracker(poolSize int, shufflePort int, shuffleWebSocketPort int, torShufflePort int, torShuffleWebSocketPort int) *Tracker

NewTracker instantiates a new tracker

func (*Tracker) CleanupDeniedByIPMatch added in v0.6.4

func (t *Tracker) CleanupDeniedByIPMatch()

CleanupDeniedByIPMatch removes timed out denyIPMatch entries.

func (*Tracker) Stats added in v0.2.0

func (t *Tracker) Stats(ip string, tor bool) *TrackerStats

Stats returns the tracker stats.

type TrackerStats added in v0.1.1

type TrackerStats struct {
	BanScore             uint32      `json:"banScore"`
	Banned               bool        `json:"banned"`
	Connections          int         `json:"connections"`
	PoolSize             int         `json:"poolSize"`
	Pools                []PoolStats `json:"pools"`
	ShufflePort          int         `json:"shufflePort"`
	ShuffleWebSocketPort int         `json:"shuffleWebSocketPort"`
}

TrackerStats represents a snapshot of the trackers statistics

Jump to

Keyboard shortcuts

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