app

package
v0.0.0-...-157bd73 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var V2rayID struct {
}

Functions

func ApplyConfig

func ApplyConfig(c map[string]json.RawMessage)

应用配置

func RegisterRoutes

func RegisterRoutes(g *gin.Engine)

注册路由

Types

type ConfigController

type ConfigController struct {
}

func (*ConfigController) Append

func (c *ConfigController) Append(g *gin.Context)

func (*ConfigController) RegisterRoutes

func (c *ConfigController) RegisterRoutes(g *gin.Engine)

type DataBaseController

type DataBaseController struct {
	// contains filtered or unexported fields
}
var (
	DataBase    *DataBaseController
	DataBaseMap *map[string]database.DataBaseObj
)

func NewDataBaseController

func NewDataBaseController(path string) (*DataBaseController, error)

初始化数据库,单例.

func (*DataBaseController) ApplyConfig

func (d *DataBaseController) ApplyConfig(c map[string]json.RawMessage) error

应用配置

func (DataBaseController) RegisterRoutes

func (self DataBaseController) RegisterRoutes(g *gin.Engine)

type SUBController

type SUBController struct {
}

func (*SUBController) Append

func (sub *SUBController) Append(c *gin.Context)

func (*SUBController) Cmd

func (sub *SUBController) Cmd(c *gin.Context)

func (*SUBController) Get

func (sub *SUBController) Get(c *gin.Context)

func (*SUBController) List

func (sub *SUBController) List(c *gin.Context)

func (*SUBController) RegisterRoutes

func (sub *SUBController) RegisterRoutes(g *gin.Engine)

type StatusController

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

func (*StatusController) ApplyConfig

func (s *StatusController) ApplyConfig(c map[string]json.RawMessage) error

func (*StatusController) ChangeStatus

func (self *StatusController) ChangeStatus(c *gin.Context)

func (*StatusController) GetStatus

func (self *StatusController) GetStatus(c *gin.Context)

func (*StatusController) RegisterRoutes

func (self *StatusController) RegisterRoutes(g *gin.Engine)

func (*StatusController) Test

func (self *StatusController) Test(c *gin.Context)

type TemplateController

type TemplateController struct {
	// contains filtered or unexported fields
}
var Template *TemplateController

func NewTemplateController

func NewTemplateController() (*TemplateController, error)

func (*TemplateController) ApplyConfig

func (t *TemplateController) ApplyConfig(c map[string]json.RawMessage) error

func (*TemplateController) DealWithPath

func (t *TemplateController) DealWithPath(g *gin.Context)

func (*TemplateController) RegisterRoutes

func (t *TemplateController) RegisterRoutes(g *gin.Engine)

注册路由,加载模板

type URLController

type URLController struct {
}
var (
	URLMap *map[string]url.URLObj
	URL    *URLController
)

func NewURLController

func NewURLController() (*URLController, error)

func (*URLController) RegisterRoutes

func (c *URLController) RegisterRoutes(g *gin.Engine)

type V2RayController

type V2RayController struct {
	// contains filtered or unexported fields
}
var V2Ray *V2RayController

func NewV2RayController

func NewV2RayController() (*V2RayController, error)

初始化内核

func (*V2RayController) AddInboundConfig

func (v *V2RayController) AddInboundConfig(config *core.InboundHandlerConfig) error

添加进站协议

func (*V2RayController) AddInboundConfigs

func (v *V2RayController) AddInboundConfigs(config []*core.InboundHandlerConfig) error

批量添加进站协议

func (*V2RayController) AddOutboundConfig

func (v *V2RayController) AddOutboundConfig(config *core.OutboundHandlerConfig) error

添加出站协议

func (*V2RayController) AddOutboundConfigs

func (v *V2RayController) AddOutboundConfigs(config []*core.OutboundHandlerConfig) error

批量添加出站协议

func (*V2RayController) ApplyConfig

func (v *V2RayController) ApplyConfig(c map[string]json.RawMessage) error

func (*V2RayController) Clear

func (v *V2RayController) Clear() error

清除所有配置

func (*V2RayController) ClearInbound

func (v *V2RayController) ClearInbound() error

func (*V2RayController) ClearOutbound

func (v *V2RayController) ClearOutbound() error

func (*V2RayController) GetInList

func (v *V2RayController) GetInList() []string

func (*V2RayController) GetOutList

func (v *V2RayController) GetOutList() []string

func (*V2RayController) LoadJSONConfig

func (v *V2RayController) LoadJSONConfig(config string) error

读取JSON数据

func (*V2RayController) RegisterRoutes

func (v *V2RayController) RegisterRoutes(g *gin.Engine)

func (*V2RayController) RemoveInboundConfig

func (v *V2RayController) RemoveInboundConfig(tag string) error

func (*V2RayController) RemoveOutboundConfig

func (v *V2RayController) RemoveOutboundConfig(tag string) error

func (*V2RayController) Start

func (v *V2RayController) Start() error

启动

func (*V2RayController) Status

func (v *V2RayController) Status() bool

func (*V2RayController) Stop

func (v *V2RayController) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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