Documentation
¶
Overview ¶
Package sessions owns user admission and the lifecycle of logical proxy sessions.
Index ¶
- func CanonicalIP(raw string) (string, error)
- func IPBlockKey(user int, ip string) string
- type ActiveIP
- type AdmissionEvent
- type Connection
- type Lease
- type LimitStatus
- type Registry
- func (r *Registry) Acquire(ctx context.Context, id int, identity, tag, ip, destination, network string, ...) (*Lease, error)
- func (r *Registry) ActiveIPs(user int) []ActiveIP
- func (r *Registry) Ban(id int, until time.Time)
- func (r *Registry) CloseAll()
- func (r *Registry) CloseConnection(id string) bool
- func (r *Registry) CloseUser(id int, tag string)
- func (r *Registry) CloseUserInbound(tag string)
- func (r *Registry) Counters() state.Traffic
- func (r *Registry) DropIP(ip string, user int) int
- func (r *Registry) ExpireBans(now time.Time) []int
- func (r *Registry) ExpireIPBlocks(now time.Time) []string
- func (r *Registry) List(after string, limit int) []Connection
- func (r *Registry) Pause(v bool)
- func (r *Registry) PruneCounters()
- func (r *Registry) RestoreBans(bans map[int]time.Time)
- func (r *Registry) RestoreIPBlocks(blocks map[string]protocol.IPBlock)
- func (r *Registry) SetIPBlock(key string, block protocol.IPBlock)
- func (r *Registry) SetInboundEpochs(epochs map[string]string)
- func (r *Registry) SetPorts(ports []protocol.PortRange)
- func (r *Registry) SetReportIPs(enabled bool)
- func (r *Registry) SetUsers(users []protocol.User)
- func (r *Registry) Summary() Summary
- type SpeedStatus
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalIP ¶
func IPBlockKey ¶
Types ¶
type AdmissionEvent ¶
type Connection ¶
type Connection struct {
ID string `json:"id"`
UserID int `json:"user_id"`
InboundTag string `json:"inbound_tag"`
SourceIP string `json:"source_ip"`
Destination string `json:"destination"`
DestinationPort int `json:"destination_port"`
Network string `json:"network"`
Started time.Time `json:"started"`
}
type Lease ¶
type Lease struct {
Info Connection
// contains filtered or unexported fields
}
type LimitStatus ¶
type Registry ¶
type Registry struct {
OnBan func(int, time.Time)
OnReject func(AdmissionEvent)
// contains filtered or unexported fields
}
func (*Registry) CloseConnection ¶
func (*Registry) CloseUserInbound ¶
func (*Registry) PruneCounters ¶
func (r *Registry) PruneCounters()
func (*Registry) RestoreIPBlocks ¶
func (*Registry) SetInboundEpochs ¶
func (*Registry) SetReportIPs ¶
type SpeedStatus ¶
Click to show internal directories.
Click to hide internal directories.