subscribe

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterExperimentalNodesForClient

func FilterExperimentalNodesForClient(list []*UserSubscribeInfo, userAgent string)

FilterExperimentalNodesForClient 按客户端 User-Agent 过滤实验性协议节点。 simnet/omniflow 等新协议仅对自有客户端/SDK(UA 命中 omnxt、slag 或 slaglab)放行, 其它客户端(含开源客户端、空 UA、未知 UA)一律剔除,避免下发无法使用的配置。

Types

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          []*SubscribeDiscount
	Replacement       int64
	Inventory         int64
	Traffic           int64
	SpeedLimit        int64
	DeviceLimit       int64
	Quota             int64
	CategoryID        int64
	CategoryName      string
	Nodes             []int
	NodeTags          []string
	NodeGroupIds      []int64
	NodeGroupId       int64
	TrafficLimit      []*TrafficLimit
	Show              bool
	Sell              bool
	Sort              int64
	DeductionRatio    int64
	AllowDeduction    bool
	ResetCycle        int64
	RenewalReset      bool
	ShowOriginalPrice bool
	PriceOptions      []SubscribePriceOption
	CreatedAt         int64
	UpdatedAt         int64
}

Subscribe 订阅信息

type SubscribeCatalog added in v1.0.9

type SubscribeCatalog struct {
	Categories    []*SubscribeCategory
	Uncategorized []*Subscribe
	Total         int32
}

type SubscribeCategory added in v1.0.9

type SubscribeCategory struct {
	ID          int64
	ParentID    int64
	Name        string
	Description string
	Language    string
	Show        bool
	Sort        int64
	List        []*Subscribe
	Children    []*SubscribeCategory
}

type SubscribeDiscount

type SubscribeDiscount struct {
	Quantity int64
	Discount float64
}

SubscribeDiscount 订阅折扣

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
	CreatedAt     int64
	UpdatedAt     int64
}

type SubscribeRepo

type SubscribeRepo interface {
	// QuerySubscribeList 查询订阅列表
	QuerySubscribeList(ctx context.Context, language string, categoryID int64) ([]*Subscribe, int32, error)
	QuerySubscribeCatalog(ctx context.Context, language string) (*SubscribeCatalog, error)
	QueryUserSubscribeNodeList(ctx context.Context, userID int64) ([]*UserSubscribeInfo, error)
}

SubscribeRepo Public Subscribe数据仓库接口

type SubscribeUseCase

type SubscribeUseCase struct {
	// contains filtered or unexported fields
}

SubscribeUseCase Public Subscribe用例

func NewSubscribeUseCase

func NewSubscribeUseCase(repo SubscribeRepo) *SubscribeUseCase

NewSubscribeUseCase 创建Public Subscribe用例

func (*SubscribeUseCase) QuerySubscribeCatalog added in v1.0.9

func (uc *SubscribeUseCase) QuerySubscribeCatalog(ctx context.Context, language string) (*SubscribeCatalog, error)

func (*SubscribeUseCase) QuerySubscribeList

func (uc *SubscribeUseCase) QuerySubscribeList(ctx context.Context, language string, categoryID int64) ([]*Subscribe, int32, error)

QuerySubscribeList 查询订阅列表

func (*SubscribeUseCase) QueryUserSubscribeNodeList

func (uc *SubscribeUseCase) QueryUserSubscribeNodeList(ctx context.Context, userID int64) ([]*UserSubscribeInfo, error)

type TrafficLimit

type TrafficLimit struct {
	StatType     string
	StatValue    int64
	TrafficUsage int64
	SpeedLimit   int64
}

type UserSubscribeInfo

type UserSubscribeInfo struct {
	ID          int64
	UserID      int64
	OrderID     int64
	SubscribeID int64
	StartTime   int64
	ExpireTime  int64
	FinishedAt  int64
	ResetTime   int64
	Traffic     int64
	Download    int64
	Upload      int64
	Token       string
	Status      int32
	CreatedAt   int64
	UpdatedAt   int64
	IsTryOut    bool
	Nodes       []*UserSubscribeNodeInfo
}

type UserSubscribeNodeInfo

type UserSubscribeNodeInfo struct {
	ID              int64
	Name            string
	Uuid            string
	Protocol        string
	Protocols       string
	Port            uint32
	Address         string
	Tags            []string
	Country         string
	City            string
	Longitude       string
	Latitude        string
	LatitudeCenter  string
	LongitudeCenter string
	CreatedAt       int64

	SNI                        string
	OmniflowCarrier            string
	OmniflowPath               string
	OmniflowContentType        string
	OmniflowProfileJson        string
	OmniflowCaCertPath         string
	OmniflowTargetMeta         string
	OmniflowSpkiPin            string
	OmniflowAdaptiveTlsEnabled bool
	OmniflowTlsFingerprint     string
	OmniflowSniMode            string
	OmniflowPaddingMode        string
	OmniflowAfEnabled          bool
	OmniflowAfPathMode         string
	OmniflowAfPathPrefix       string
	OmniflowAfPathSuffix       string
	OmniflowAfPathRotationSecs int
	OmniflowAfPathSkewSlots    int
}

Jump to

Keyboard shortcuts

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