sub

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: GPL-3.0 Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ProxyGroups = `` /* 162-byte string literal not displayed */

Variables

This section is empty.

Functions

func NewSubHandler

func NewSubHandler(g *gin.RouterGroup) error

Types

type ClashService

type ClashService struct {
	service.SettingService
	JsonService
	LinkService
}

func (*ClashService) ConvertToClashMeta

func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}, basicConfig string) (string, error)

func (*ClashService) GetClash

func (s *ClashService) GetClash(subId string) (*string, []string, error)

type ClientInfo added in v1.7.2

type ClientInfo struct {
	Name             string `json:"name"`
	Remark           string `json:"remark,omitempty"`
	Title            string `json:"title"`
	Enable           bool   `json:"enable"`
	Expiry           int64  `json:"expiry"`
	RemainingDays    int64  `json:"remainingDays"`
	Volume           int64  `json:"volume"`
	Up               int64  `json:"up"`
	Down             int64  `json:"down"`
	Used             int64  `json:"used"`
	RemainingTraffic int64  `json:"remainingTraffic"`
	Unlimited        bool   `json:"unlimited"`
	// Expired is decided here rather than from Expiry in the browser, so the
	// page cannot disagree with the panel over a skewed client clock.
	Expired bool     `json:"expired"`
	Links   []string `json:"links"`
}

ClientInfo is the payload served by the subscriber dashboard's JSON info endpoint. It carries everything the Vue page needs to render live status: expiry/remaining days, used vs total traffic, and the config links.

type JsonService

type JsonService struct {
	service.SettingService
	LinkService
}

func (*JsonService) GetJson

func (j *JsonService) GetJson(subId string, format string) (*string, []string, error)
type Link struct {
	Type   string `json:"type"`
	Remark string `json:"remark"`
	Uri    string `json:"uri"`
}

type LinkService

type LinkService struct {
}

func (*LinkService) GetExternalOutbounds added in v1.5.4

func (s *LinkService) GetExternalOutbounds(linkJson *json.RawMessage) ([]map[string]interface{}, []string)

func (*LinkService) GetExternalOutboundsForClash added in v1.9.3

func (s *LinkService) GetExternalOutboundsForClash(linkJson *json.RawMessage) ([]map[string]interface{}, []string)

GetExternalOutboundsForClash is GetExternalOutbounds for the Clash export: external vless links on Xray's XHTTP transport keep it (see util.GetOutboundForClash), where the sing-box JSON export has to drop it.

func (s *LinkService) GetLinkList(linkJson *json.RawMessage, types string, clientInfo string) []Link

GetLinkList is GetLinks with the remarks kept.

The remark is what a link is called on screen -- it names the inbound the link belongs to -- and any caller offering one link at a time needs it to label the choice. A remote subscription expands into several links that share the stored entry's remark, since the remote gives no per-link name here.

func (s *LinkService) GetLinks(linkJson *json.RawMessage, types string, clientInfo string) []string

type Server

type Server struct {
	service.SettingService
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) GetCtx

func (s *Server) GetCtx() context.Context

func (*Server) Start

func (s *Server) Start() (err error)

func (*Server) Stop

func (s *Server) Stop() error

type SubService

type SubService struct {
	service.SettingService
	LinkService
}

func (*SubService) GetSubs

func (s *SubService) GetSubs(subId string) (*string, []string, error)

Jump to

Keyboard shortcuts

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