Documentation
¶
Index ¶
- type StatReader
- type StatWriter
- type TrafficCounter
- func (c *TrafficCounter) Delete(email string)
- func (c *TrafficCounter) GetCounter(email string) *TrafficStorage
- func (c *TrafficCounter) GetDownCount(email string) int64
- func (c *TrafficCounter) GetUpCount(email string) int64
- func (c *TrafficCounter) Len() int
- func (c *TrafficCounter) Reset(email string)
- type TrafficStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatReader ¶
type StatReader struct {
Reader buf.TimeoutReader
Storage *TrafficStorage
}
func (*StatReader) Interrupt ¶
func (r *StatReader) Interrupt()
func (*StatReader) ReadMultiBuffer ¶
func (r *StatReader) ReadMultiBuffer() (buf.MultiBuffer, error)
func (*StatReader) ReadMultiBufferTimeout ¶
func (r *StatReader) ReadMultiBufferTimeout(d interface{ Nanoseconds() int64 }) (buf.MultiBuffer, error)
type StatWriter ¶
type StatWriter struct {
Writer buf.Writer
Storage *TrafficStorage
}
func (*StatWriter) Close ¶
func (w *StatWriter) Close() error
func (*StatWriter) Interrupt ¶
func (w *StatWriter) Interrupt()
func (*StatWriter) WriteMultiBuffer ¶
func (w *StatWriter) WriteMultiBuffer(mb buf.MultiBuffer) error
type TrafficCounter ¶
type TrafficCounter struct {
// contains filtered or unexported fields
}
TrafficCounter holds per-user storage, keyed by email.
func NewTrafficCounter ¶
func NewTrafficCounter() *TrafficCounter
func (*TrafficCounter) Delete ¶
func (c *TrafficCounter) Delete(email string)
func (*TrafficCounter) GetCounter ¶
func (c *TrafficCounter) GetCounter(email string) *TrafficStorage
func (*TrafficCounter) GetDownCount ¶
func (c *TrafficCounter) GetDownCount(email string) int64
func (*TrafficCounter) GetUpCount ¶
func (c *TrafficCounter) GetUpCount(email string) int64
func (*TrafficCounter) Len ¶
func (c *TrafficCounter) Len() int
func (*TrafficCounter) Reset ¶
func (c *TrafficCounter) Reset(email string)
Click to show internal directories.
Click to hide internal directories.