Documentation
¶
Index ¶
Constants ¶
View Source
const Name = "STATISTICS"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator interface {
io.Closer
AuthUser(hash string) (valid bool, user User)
AddUser(hash string) error
DelUser(hash string) error
SetUserTraffic(hash string, sent, recv uint64) error
SetUserSpeedLimit(hash string, send, recv int) error
SetUserIPLimit(hash string, limit int) error
SetUserQuota(hash string, quota int64) error
ListUsers() []User
}
func NewAuthenticator ¶
func NewAuthenticator(ctx context.Context, name string) (Authenticator, error)
type Metadata ¶
type Metadata interface {
GetHash() string
GetTraffic() (sent, recv uint64)
GetSpeedLimit() (sent, recv int)
GetIPLimit() int
GetQuota() int64
// Done returns a channel that is closed when the user has been cut off
// (e.g. quota exceeded, user removed by an operator). Tunnels are
// expected to watch this channel after authentication and tear down the
// underlying connection so that an in-flight relay does not keep
// shovelling bytes after enforcement has fired (P0-3d).
Done() <-chan struct{}
}
type Persistencer ¶
type TrafficMeter ¶
type User ¶
type User interface {
Metadata
TrafficMeter
IPRecorder
}
Click to show internal directories.
Click to hide internal directories.