query

package
v0.0.0-...-61ba746 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenConfig

func ListenConfig(ctx context.Context) error

ListenConfig watch config file

func LoadConfig

func LoadConfig() error

LoadConfig load config from config file

func ParseConfig

func ParseConfig(uuid string) ([]helper.Endpoint, error)

ParseConfig parse config to endpoint by uuid

func ProxyNodeHandler

func ProxyNodeHandler(s *Source) ([]helper.Endpoint, error)

func RawNodeHandler

func RawNodeHandler(s *Source) ([]helper.Endpoint, error)

RawNodeHandler parse raw source

func Serve

func Serve(path string) (string, error)

Serve serve http server with config, return listen address

func URLNodeHandler

func URLNodeHandler(s *Source) ([]helper.Endpoint, error)

URLNodeHandler parse url source

func URLToEndpoint

func URLToEndpoint(uris ...string) []helper.Endpoint

URLToEndpoint parse uri array to endpoint array

func V2rayNodeHandler

func V2rayNodeHandler(s *Source) ([]helper.Endpoint, error)

V2rayNodeHandler parse v2ray source

Types

type Config

type Config struct {
	Address string              `json:"addr"`
	Valid   map[string][]Source `json:"valid"`
}

Config -

type Fmt

type Fmt struct {
	Vmess string `json:"vmess"`
	SS    string `json:"ss"`
}

Fmt -

type Server

type Server struct{}

Server -

func (*Server) Query

func (s *Server) Query(ctx context.Context, request *pb.Request) (*pb.Reply, error)

Query grpc service

type Source

type Source struct {
	Type    string            `json:"type"`
	File    string            `json:"file"`
	Host    string            `json:"host"`
	Addr    string            `json:"addr"`
	Fmt     Fmt               `json:"fmt"`
	Rewrite map[string]string `json:"rewrite"`
}

Source subserver source

Jump to

Keyboard shortcuts

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