model

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTypeEmail    = "email"
	AuthTypeMobile   = "mobile"
	AuthTypeApple    = "apple"
	AuthTypeGoogle   = "google"
	AuthTypeGithub   = "github"
	AuthTypeFacebook = "facebook"
	AuthTypeTelegram = "telegram"
)

AuthType 认证类型常量

View Source
const (
	TypeUserTrafficRank   int8 = 40 // Top 10 User traffic rank log
	TypeServerTrafficRank int8 = 41 // Top 10 Server traffic rank log
	TypeTrafficStat       int8 = 42 // Daily traffic statistics log
)

System log type constants

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerTraffic

type ServerTraffic struct {
	ServerID int64 `json:"server_id"`
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
	Total    int64 `json:"total"`
}

ServerTraffic represents server traffic data

type ServerTrafficRank

type ServerTrafficRank struct {
	Rank []ServerTraffic `json:"rank"` // Array of server traffic, ordered by rank
}

ServerTrafficRank represents server traffic ranking

func (*ServerTrafficRank) Marshal

func (s *ServerTrafficRank) Marshal() ([]byte, error)

Marshal implements json.Marshaler for ServerTrafficRank

func (*ServerTrafficRank) Unmarshal

func (s *ServerTrafficRank) Unmarshal(data []byte) error

Unmarshal implements json.Unmarshaler for ServerTrafficRank

type Subscribe

type Subscribe struct {
	ID                int64
	Name              string
	Language          string
	Description       string
	UnitPrice         int64
	UnitTime          string
	Discount          string // JSON string
	Replacement       int64
	Inventory         int64
	Traffic           int64
	SpeedLimit        int64
	DeviceLimit       int64
	Quota             int64
	Nodes             string // Comma-separated int64 IDs
	NodeTags          string // Comma-separated tags
	NodeGroupIDs      []int64
	NodeGroupID       int64
	TrafficLimit      string // JSON string
	Show              bool
	Sell              bool
	Sort              int64
	DeductionRatio    int64
	AllowDeduction    bool
	ResetCycle        int64
	RenewalReset      bool
	ShowOriginalPrice bool
}

Subscribe subscribe model for data layer

type SubscribeDiscount

type SubscribeDiscount struct {
	Quantity int64 `json:"quantity"` // Number of months
	Discount int64 `json:"discount"` // Discount value
}

SubscribeDiscount discount configuration

type SubscribeGroup

type SubscribeGroup struct {
	ID                  int64
	Name                string
	Description         string
	IsExpiredGroup      bool
	ExpiredDaysLimit    int64
	MaxTrafficGBExpired int64
	SpeedLimit          int64
}

SubscribeGroup subscribe group model

type SubscribeListParams

type SubscribeListParams struct {
	Page        int
	Size        int
	Language    string
	Search      string
	NodeGroupID int64
	IDs         []int64 // For filtering by specific IDs
}

SubscribeListParams subscribe list query parameters

type TrafficLimit

type TrafficLimit struct {
	StatType     string `json:"stat_type"`
	StatValue    int64  `json:"stat_value"`
	TrafficUsage int64  `json:"traffic_usage"`
	SpeedLimit   int64  `json:"speed_limit"`
}

TrafficLimit traffic limit configuration

type TrafficStat

type TrafficStat struct {
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
	Total    int64 `json:"total"`
}

TrafficStat represents daily traffic statistics

func (*TrafficStat) Marshal

func (t *TrafficStat) Marshal() ([]byte, error)

Marshal implements json.Marshaler for TrafficStat

func (*TrafficStat) Unmarshal

func (t *TrafficStat) Unmarshal(data []byte) error

Unmarshal implements json.Unmarshaler for TrafficStat

type UserSubscribeStatus

type UserSubscribeStatus uint8

UserSubscribeStatus 用户订阅状态常量

const (
	UserSubscribeStatusPending UserSubscribeStatus = 0 // 待激活
	UserSubscribeStatusActive  UserSubscribeStatus = 1 // 激活
	UserSubscribeStatusFinish  UserSubscribeStatus = 2 // 完成
	UserSubscribeStatusExpired UserSubscribeStatus = 3 // 过期
	UserSubscribeStatusDeduct  UserSubscribeStatus = 4 // 已扣除
)

type UserTraffic

type UserTraffic struct {
	UserID      int64 `json:"user_id"`
	SubscribeID int64 `json:"subscribe_id"`
	Upload      int64 `json:"upload"`
	Download    int64 `json:"download"`
	Total       int64 `json:"total"`
}

UserTraffic represents user traffic data

type UserTrafficRank

type UserTrafficRank struct {
	Rank []UserTraffic `json:"rank"` // Array of user traffic, ordered by rank
}

UserTrafficRank represents user traffic ranking

func (*UserTrafficRank) Marshal

func (u *UserTrafficRank) Marshal() ([]byte, error)

Marshal implements json.Marshaler for UserTrafficRank

func (*UserTrafficRank) Unmarshal

func (u *UserTrafficRank) Unmarshal(data []byte) error

Unmarshal implements json.Unmarshaler for UserTrafficRank

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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