mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-08 14:13:22 +00:00
API: Fix Online Map (#5732)
https://github.com/XTLS/Xray-core/pull/5732#pullrequestreview-3863990264
This commit is contained in:
@@ -25,14 +25,16 @@ type Counter interface {
|
||||
//
|
||||
// xray:api:stable
|
||||
type OnlineMap interface {
|
||||
// Count is the current value of the OnlineMap.
|
||||
// Count returns the number of unique online IPs.
|
||||
Count() int
|
||||
// AddIP adds a ip to the current OnlineMap.
|
||||
// AddIP increments the reference count for the given IP.
|
||||
AddIP(string)
|
||||
// List is the current OnlineMap ip list.
|
||||
// RemoveIP decrements the reference count for the given IP. Deletes at zero.
|
||||
RemoveIP(string)
|
||||
// List returns all currently online IPs.
|
||||
List() []string
|
||||
// IpTimeMap return client ips and their last access time.
|
||||
IpTimeMap() map[string]time.Time
|
||||
// IPTimeMap returns a snapshot copy of IPs to their last-seen times.
|
||||
IPTimeMap() map[string]time.Time
|
||||
}
|
||||
|
||||
// Channel is the interface for stats channel.
|
||||
|
||||
Reference in New Issue
Block a user