statistics

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DownloadKey = []byte{'D', 'O', 'W', 'N', 'L', 'O', 'A', 'D'}
	UploadKey   = []byte{'U', 'P', 'L', 'O', 'A', 'D'}

	SyncThreshold int64 = 1024 * 1024 * 50 // bytes
)

Functions

This section is empty.

Types

type Connections

type Connections struct {
	gs.UnimplementedConnectionsServer

	netapi.Proxy

	Cache *TotalCache
	// contains filtered or unexported fields
}

func NewConnStore

func NewConnStore(cache cache.Cache, dialer netapi.Proxy) *Connections

func (*Connections) Close

func (c *Connections) Close() error

func (*Connections) CloseConn

func (*Connections) Conn

func (c *Connections) Conn(ctx context.Context, addr netapi.Address) (net.Conn, error)

func (*Connections) Conns

func (*Connections) FailedHistory added in v0.3.7

func (*Connections) Notify

func (*Connections) PacketConn

func (c *Connections) PacketConn(ctx context.Context, addr netapi.Address) (net.PacketConn, error)

func (*Connections) Remove

func (c *Connections) Remove(id uint64)

func (*Connections) Total

type FailedHistory added in v0.3.7

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

func (*FailedHistory) Get added in v0.3.7

func (*FailedHistory) Push added in v0.3.7

func (h *FailedHistory) Push(ctx context.Context, err error, protocol string, host netapi.Address)

type TotalCache

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

func NewTotalCache

func NewTotalCache(cache cache.Cache) *TotalCache

func (*TotalCache) AddDownload

func (c *TotalCache) AddDownload(d uint64)

func (*TotalCache) AddUpload

func (c *TotalCache) AddUpload(d uint64)

func (*TotalCache) Close

func (c *TotalCache) Close()

func (*TotalCache) LoadDownload

func (c *TotalCache) LoadDownload() uint64

func (*TotalCache) LoadUpload

func (c *TotalCache) LoadUpload() uint64

Jump to

Keyboard shortcuts

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