counter

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrafficCounter

type TrafficCounter struct {
	Counters sync.Map
}

func NewTrafficCounter

func NewTrafficCounter() *TrafficCounter

func (*TrafficCounter) Delete

func (c *TrafficCounter) Delete(uuid string)

func (*TrafficCounter) GetCounter

func (c *TrafficCounter) GetCounter(uuid string) *TrafficStorage

func (*TrafficCounter) GetDownCount

func (c *TrafficCounter) GetDownCount(uuid string) int64

func (*TrafficCounter) GetUpCount

func (c *TrafficCounter) GetUpCount(uuid string) int64

func (*TrafficCounter) Len

func (c *TrafficCounter) Len() int

func (*TrafficCounter) Reset

func (c *TrafficCounter) Reset(uuid string)

func (*TrafficCounter) Rx

func (c *TrafficCounter) Rx(uuid string, n int)

func (*TrafficCounter) Tx

func (c *TrafficCounter) Tx(uuid string, n int)

type TrafficStorage

type TrafficStorage struct {
	UpCounter   atomic.Int64
	DownCounter atomic.Int64
}

type XrayTrafficCounter

type XrayTrafficCounter struct {
	V *atomic.Int64
}

func (*XrayTrafficCounter) Add

func (c *XrayTrafficCounter) Add(delta int64) int64

func (*XrayTrafficCounter) Set

func (c *XrayTrafficCounter) Set(newValue int64) int64

func (*XrayTrafficCounter) Value

func (c *XrayTrafficCounter) Value() int64

Jump to

Keyboard shortcuts

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