镜像自地址
https://github.com/therootcompany/telebit.git
已同步 2025-07-06 12:26:36 +00:00
- got too cute with the package names, needed to bring everything into one package, except for packer. - system is passing traffic now, ran a load test generating 1000 connections, seems ok. - removed a lot of message logging since traffic is passing.
40 行
713 B
Go
40 行
713 B
Go
package genericlistener
|
|
|
|
//DomainTrack -- Tracking specifics for domains
|
|
type DomainTrack struct {
|
|
DomainName string
|
|
bytesIn int64
|
|
bytesOut int64
|
|
}
|
|
|
|
//NewDomainTrack -- Constructor
|
|
func NewDomainTrack(domainName string) (p *DomainTrack) {
|
|
p = new(DomainTrack)
|
|
p.DomainName = domainName
|
|
p.bytesIn = 0
|
|
p.bytesOut = 0
|
|
return
|
|
}
|
|
|
|
//BytesIn -- Property
|
|
func (c *DomainTrack) BytesIn() (b int64) {
|
|
b = c.bytesIn
|
|
return
|
|
}
|
|
|
|
//BytesOut -- Property
|
|
func (c *DomainTrack) BytesOut() (b int64) {
|
|
b = c.bytesOut
|
|
return
|
|
}
|
|
|
|
//AddIn - Porperty
|
|
func (c *DomainTrack) AddIn(num int64) {
|
|
c.bytesIn = c.bytesIn + num
|
|
}
|
|
|
|
//AddOut -- Property
|
|
func (c *DomainTrack) AddOut(num int64) {
|
|
c.bytesOut = c.bytesOut + num
|
|
}
|