webservice

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionKeyUid     = "Uid"
	SessionKeyUserKey = "UserKey"
	SessionKeyUserIp  = "UserIp"
)

Variables

This section is empty.

Functions

func AddCrawlerNode

func AddCrawlerNode(c *fiber.Ctx) error

func AddNode

func AddNode(c *fiber.Ctx) error

func ChangePassword

func ChangePassword(c *fiber.Ctx) error

func CheckUsable

func CheckUsable(c *fiber.Ctx) error

func InitHttpService

func InitHttpService() (bool, error)

func InitStorage

func InitStorage() error

func InitWs

func InitWs(app *fiber.App) error

func NodeList

func NodeList(ctx *fiber.Ctx) error

func Pac

func Pac(c *fiber.Ctx) error

func Registration

func Registration(c *fiber.Ctx) error

func SubClash

func SubClash(c *fiber.Ctx) error

func SubV2ray

func SubV2ray(c *fiber.Ctx) error

func SyncNode

func SyncNode(c *fiber.Ctx) error

func Version

func Version(c *fiber.Ctx) error

Types

type AddCrawlerNodeReq

type AddCrawlerNodeReq struct {
	NodeUrl     string                  `json:"node_url" validate:"required"`
	CrawlerType domain.CrawlType        `json:"crawler_type"`
	Rule        domain.CrawlerConf_Rule `json:"rule"`
	UseTpe      domain.UseType          `json:"use_tpe"`
}

type AddNodeReq

type AddNodeReq struct {
	NodeUrl string `json:"node_url" validate:"required"`
}

type Init added in v0.0.4

type Init struct {
}

func (*Init) Init added in v0.0.4

func (p *Init) Init() (needRun bool, err error)

func (*Init) Name added in v0.0.4

func (p *Init) Name() string

func (*Init) WaitFinish added in v0.0.4

func (p *Init) WaitFinish()

type Sub added in v0.0.5

type Sub struct {
	Limit          *int     `json:"limit" query:"limit" yaml:"limit"  default:"50"`
	DnsServiceList []string `json:"dns_service_list" query:"dns_service_list" yaml:"dns_service_list"`
	EnableIpv6     *bool    `json:"enable_ipv6" query:"enable_ipv6" yaml:"enable_ipv6"`
	CheckProxy     *bool    `json:"check_proxy" query:"check_proxy" yaml:"check_proxy"`
}

type WsClient

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

func NewWsClient

func NewWsClient(c *websocket.Conn) *WsClient

func (*WsClient) Init

func (p *WsClient) Init(clientId string) error

func (*WsClient) RecvMsgForever

func (p *WsClient) RecvMsgForever()

func (*WsClient) SendMsg

func (p *WsClient) SendMsg(msg interface{}) error

type WsClientDispatch

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

func NewWsClientDispatch

func NewWsClientDispatch() *WsClientDispatch

func (*WsClientDispatch) Add

func (p *WsClientDispatch) Add(c *websocket.Conn) error

func (*WsClientDispatch) OnClose

func (p *WsClientDispatch) OnClose(clientId string)

Jump to

Keyboard shortcuts

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