model

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 2 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

View Source
var ErrSubscribePriceOptionModified = errors.New("subscribe price option has been modified")

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
	ShortDescription  string
	Features          string
	DetailFormat      string
	DetailContent     string
	UnitPrice         int64
	UnitTime          string
	Discount          string // JSON string
	Replacement       int64
	Inventory         int64
	Traffic           int64
	SpeedLimit        int64
	DeviceLimit       int64
	Quota             int64
	CategoryID        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
	PriceOptions      []SubscribePriceOption
}

Subscribe subscribe model for data layer

type SubscribeCategory added in v1.0.9

type SubscribeCategory struct {
	ID          int64
	ParentID    int64
	Name        string
	Description string
	Language    string
	Show        bool
	Sort        int64
}

SubscribeCategory subscribe product category model.

type SubscribeCategoryListParams added in v1.0.9

type SubscribeCategoryListParams struct {
	Language string
	ParentID *int64
	Show     *bool
}

SubscribeCategoryListParams subscribe product category query parameters.

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
	CategoryID  int64
	IDs         []int64 // For filtering by specific IDs
}

SubscribeListParams subscribe list query parameters

type SubscribePriceOption added in v1.0.10

type SubscribePriceOption struct {
	ID            int64
	SubscribeID   int64
	Code          string
	Type          string
	Name          string
	DurationUnit  string
	DurationValue int64
	Price         int64
	OriginalPrice int64
	Inventory     int64
	Show          bool
	Sell          bool
	IsDefault     bool
	Sort          int64
	Version       int32
	CreatedAt     int64
	UpdatedAt     int64
}

SubscribePriceOption represents a concrete sellable price/duration option for a subscribe product.

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