sub

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

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 (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