Documentation ¶
Index ¶
- func NewPeerTrafficUpdateEventSender(runtime *runtime.TunnelRuntime, eventLog eventlog.EventManager, ...) *peerTrafficUpdateEventSender
- type CachedStatistics
- type Manager
- func (manager *Manager) ConnectPeer(info *types.PeerInfo) error
- func (manager *Manager) GetCachedStatistics() *CachedStatistics
- func (manager *Manager) GetPeer(id int64) (*types.PeerInfo, error)
- func (manager *Manager) GetRuntimePeerStat(peer *types.PeerInfo) *runtimePeerStat
- func (manager *Manager) ListPeers() ([]*types.PeerInfo, error)
- func (manager *Manager) Running() bool
- func (manager *Manager) SetPeer(info *types.PeerInfo) error
- func (manager *Manager) Shutdown() error
- func (manager *Manager) UnsetPeer(id int64) error
- func (manager *Manager) UnsetPeerByIdentifiers(identifiers *types.PeerIdentifiers) error
- func (manager *Manager) UpdatePeer(info *types.PeerInfo) error
- func (manager *Manager) UpdatePeerExpiration(identifiers *types.PeerIdentifiers, expires *time.Time) error
- type PeerTraffic
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPeerTrafficUpdateEventSender ¶ added in v0.3.5
func NewPeerTrafficUpdateEventSender(runtime *runtime.TunnelRuntime, eventLog eventlog.EventManager, statsService *runtimePeerStatsService, peers []*types.PeerInfo) *peerTrafficUpdateEventSender
Types ¶
type CachedStatistics ¶
type CachedStatistics struct { // PeersTotal is a number of peers // being authorized to connect to this node PeersTotal int // PeersWithTraffic is a number of peers // being actually connected to this node PeersWithTraffic int // PeersActiveLastHour is number of peers // having any exchange during last hour PeersActiveLastHour int // PeersActiveLastDay is number of peers // having any exchange during last 24 hours PeersActiveLastDay int // Wireguard link statistic, may be nil LinkStat *netlink.LinkStatistics // Upstream traffic totally (bytes) Upstream int64 // Upstream speed totally (bytes per second) UpstreamSpeed int64 // Downstream traffic totally (bytes) Downstream int64 // Downstream speed totally (bytes per second) DownstreamSpeed int64 // The time in seconds then statistics was collected Collected int64 }
func (*CachedStatistics) CalcSpeed ¶ added in v0.3.5
func (s *CachedStatistics) CalcSpeed(prevStats *CachedStatistics) *speedValue
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) GetCachedStatistics ¶
func (manager *Manager) GetCachedStatistics() *CachedStatistics
func (*Manager) GetRuntimePeerStat ¶ added in v0.3.5
func (*Manager) UnsetPeerByIdentifiers ¶
func (manager *Manager) UnsetPeerByIdentifiers(identifiers *types.PeerIdentifiers) error
func (*Manager) UpdatePeerExpiration ¶
type PeerTraffic ¶ added in v0.3.5
type Session ¶ added in v0.3.5
type Session struct { ActivityID uuid.UUID // id describing the session Seconds int64 // session seconds UpstreamDelta int64 // delta in bytes between previous and current Upstream Upstream int64 // current Upstream value in bytes DownstreamDelta int64 // delta in bytes between previous and current Downstream Downstream int64 // current Downstream value in bytes Country string // user country }
Click to show internal directories.
Click to hide internal directories.