Documentation ¶
Index ¶
- Constants
- Variables
- func IsAlreadyExistsError(e error) bool
- func IsNotFoundError(e error) bool
- type Manager
- func (m *Manager) AddUser(ctx context.Context, u User) (bool, error)
- func (m *Manager) GetTrafficAndReset(ctx context.Context, u User) (TrafficInfo, error)
- func (m *Manager) GetUserList(ctx context.Context, reset bool) ([]UserData, error)
- func (m *Manager) RemoveUser(ctx context.Context, u User) error
- func (m *Manager) SetLogger(l *slog.Logger)
- type TrafficInfo
- type User
- type UserData
Constants ¶
View Source
const ( UplinkFormat = "user>>>%s>>>traffic>>>uplink" DownlinkFormat = "user>>>%s>>>traffic>>>downlink" )
Variables ¶
View Source
var (
TODOErr = fmt.Errorf("TODO error ")
)
Functions ¶
func IsAlreadyExistsError ¶
func IsNotFoundError ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) GetTrafficAndReset ¶
@todo error handle
func (*Manager) GetUserList ¶
type TrafficInfo ¶
type TrafficInfo struct {
Up, Down int64
}
type UserData ¶
type UserData struct { User User TrafficInfo TrafficInfo }
Click to show internal directories.
Click to hide internal directories.