Documentation ¶
Index ¶
Constants ¶
View Source
const ( SubscriptionTypeVmess = "vmess" SubscriptionTypeTrojan = "trojan" )
Variables ¶
This section is empty.
Functions ¶
func GetAllModels ¶
func GetAllModels() []interface{}
Types ¶
type FlexString ¶
type FlexString string
A FlexString is an string that can be unmarshalled from a JSON field that has either a number or a string value. E.g. if the json field contains an string "42", the FlexString value will be "42".
func (*FlexString) UnmarshalJSON ¶
func (fi *FlexString) UnmarshalJSON(b []byte) error
type GenericStatus ¶
type GenericStatus struct { Code int `json:"code"` Message string `json:"message,omitempty" ` Data interface{} `json:"data,omitempty"` }
func NewGenericData ¶
func NewGenericData(code int, data interface{}) *GenericStatus
func NewGenericStatus ¶
func NewGenericStatus(code int, message string) *GenericStatus
type Modeler ¶
type Modeler interface { GetCacheKey() string GetCacheDuration() time.Duration encoding.BinaryMarshaler encoding.BinaryUnmarshaler }
type PacContent ¶
func NewPacContent ¶
func NewPacContent(content string) *PacContent
func (*PacContent) GetCacheDuration ¶
func (c *PacContent) GetCacheDuration() time.Duration
func (*PacContent) GetCacheKey ¶
func (c *PacContent) GetCacheKey() string
func (*PacContent) MarshalBinary ¶
func (c *PacContent) MarshalBinary() ([]byte, error)
func (*PacContent) TableName ¶
func (c *PacContent) TableName() string
func (*PacContent) UnmarshalBinary ¶
func (c *PacContent) UnmarshalBinary(data []byte) error
type PacHandlerConfig ¶
type PacWebSite ¶
func NewPacWebSite ¶
func NewPacWebSite(s string) *PacWebSite
func NewPacWebSiteForDelete ¶
func NewPacWebSiteForDelete(id int64) *PacWebSite
func (*PacWebSite) GetCacheDuration ¶
func (p *PacWebSite) GetCacheDuration() time.Duration
func (*PacWebSite) GetCacheKey ¶
func (p *PacWebSite) GetCacheKey() string
func (*PacWebSite) MarshalBinary ¶
func (p *PacWebSite) MarshalBinary() ([]byte, error)
func (*PacWebSite) Render ¶
func (p *PacWebSite) Render() *PacWebSiteToRender
func (*PacWebSite) TableName ¶
func (p *PacWebSite) TableName() string
func (*PacWebSite) UnmarshalBinary ¶
func (p *PacWebSite) UnmarshalBinary(data []byte) error
type PacWebSiteToRender ¶
type PacWebSiteToRender struct { Id uint `json:"id"` WebSiteUrl string `validate:"required" json:"url"` }
func RenderPacWebSites ¶
func RenderPacWebSites(before []*PacWebSite) []*PacWebSiteToRender
type Subscription ¶
type Subscription struct { Id int64 `json:"id"` Name string `json:"subscription_name"` Addr string `json:"subscription_addr"` }
func NewSubscription ¶
func NewSubscription(name, addr string) *Subscription
func (*Subscription) GetCacheDuration ¶
func (s *Subscription) GetCacheDuration() time.Duration
func (*Subscription) GetCacheKey ¶
func (s *Subscription) GetCacheKey() string
func (*Subscription) MarshalBinary ¶
func (s *Subscription) MarshalBinary() ([]byte, error)
func (*Subscription) TableName ¶
func (s *Subscription) TableName() string
func (*Subscription) UnmarshalBinary ¶
func (s *Subscription) UnmarshalBinary(data []byte) error
type V2rayCoreStatus ¶
type V2rayCoreStatus struct {
StartTime string `json:"start_time"`
}
type V2rayNode ¶
type V2rayNode struct { Id int64 `json:"primary_key"` SubscriptionId int64 `json:"subscription_id"` SubscriptionName string `json:"subscription_name"` SubscriptionType string `json:"subscription_type"` //props for v2ray start Host string `json:"host"` Path string `json:"path"` TLS string `json:"tls"` Address string `json:"add"` Port FlexString `json:"port"` Aid FlexString `json:"aid"` Net string `json:"net"` Type string `json:"type"` V string `json:"v"` Name string `json:"ps"` ServerId string `json:"id"` PingRTT int64 `json:"ping_rtt"` //props for trojan start Password string `json:"password"` Sni string `json:"sni"` }
func NewV2rayNode ¶
func (*V2rayNode) GetCacheDuration ¶
func (*V2rayNode) GetCacheKey ¶
func (*V2rayNode) MarshalBinary ¶
func (*V2rayNode) UnmarshalBinary ¶
type V2rayStatus ¶
type V2rayStatus struct { CurrentNode *V2rayNode `json:"current_node"` Core *V2rayCoreStatus `json:"v2ray_core"` RefreshTime string `json:"refresh_time"` InboundTraffic []Traffic `json:"inbound_traffic"` OutboundTraffic []Traffic `json:"outbound_traffic"` }
Click to show internal directories.
Click to hide internal directories.