mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 16:01:55 +03:00
Add doppel and tls packages
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package doppel
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
ScoutConnCollectedPreallocSize = 100
|
||||
)
|
||||
|
||||
type ScoutConnResult struct {
|
||||
timestamp time.Time
|
||||
recordType byte
|
||||
}
|
||||
|
||||
type ScoutConnCollected struct {
|
||||
data []ScoutConnResult
|
||||
}
|
||||
|
||||
func (s *ScoutConnCollected) Add(record byte) {
|
||||
s.data = append(s.data, ScoutConnResult{
|
||||
timestamp: time.Now(),
|
||||
recordType: record,
|
||||
})
|
||||
}
|
||||
|
||||
func NewScoutConnCollected() *ScoutConnCollected {
|
||||
return &ScoutConnCollected{
|
||||
data: make([]ScoutConnResult, 0, ScoutConnCollectedPreallocSize),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user