proxytable

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAllowLoginAttempts = 50
View Source
const DefaultLoginAttemptWindow = 15 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestrator

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

func (*Orchestrator) CollectDeltas

func (orch *Orchestrator) CollectDeltas() []TrafficDelta

func (*Orchestrator) RefreshTable

func (orch *Orchestrator) RefreshTable(ctx context.Context, services []ProxyServiceEntry) error

func (*Orchestrator) ReturnDeltas

func (orch *Orchestrator) ReturnDeltas(entries []TrafficDelta)

func (*Orchestrator) Services

func (orch *Orchestrator) Services() []ServiceStatus

func (*Orchestrator) Shutdown

func (orch *Orchestrator) Shutdown(ctx context.Context) error

type PeerLoginOptions

type PeerLoginOptions struct {
	MaxAttempts   int `json:"max_attempts"`
	AttemptWindow int `json:"attempt_window"`
}

func (*PeerLoginOptions) RateLimiter

func (opts *PeerLoginOptions) RateLimiter() (quota int, window time.Duration)

type PeerStatus

type PeerStatus struct {
	ID       string `json:"id"`
	Username string `json:"username,omitempty"`
	Enabled  bool   `json:"enabled"`
}

type ProxyPeerBandwidth

type ProxyPeerBandwidth struct {
	RxBytes int `json:"rx"`
	TxBytes int `json:"tx"`
}

type ProxyPeerUserInfo

type ProxyPeerUserInfo struct {
	Username string `json:"username"`
	Password string `json:"password"`

	Options *PeerLoginOptions `json:"options"`
}

type ProxyServiceEntry

type ProxyServiceEntry struct {
	ProxyServiceOptions
	Peers []ProxyTablePeerEntry `json:"peers"`
}

type ProxyServiceOptions

type ProxyServiceOptions struct {
	BindAddr string `json:"bind_addr"`
	Service  string `json:"service"`

	http_pkg.HttpServiceOptions
}

type ProxyTablePeerEntry

type ProxyTablePeerEntry struct {
	ID             string              `json:"id"`
	Userinfo       *ProxyPeerUserInfo  `json:"userinfo"`
	Enabled        bool                `json:"enabled"`
	MaxConnections int                 `json:"max_connections"`
	Bandwidth      *ProxyPeerBandwidth `json:"bandwidth"`
	DNS            string              `json:"dns"`
	OutboundAddr   string              `json:"outbound_addr"`
}

type ServiceStatus

type ServiceStatus struct {
	BindAddr string       `json:"bind_addr"`
	Type     string       `json:"type"`
	Up       bool         `json:"up"`
	Peers    []PeerStatus `json:"peers"`
	Error    string       `json:"error,omitempty"`
}

type TrafficDelta

type TrafficDelta struct {
	PeerID  string `json:"peer_id"`
	RxBytes int64  `json:"rx"`
	TxBytes int64  `json:"tx"`
}

Jump to

Keyboard shortcuts

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