cmd

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtCheckUNKNOWN = iota
	EtCheckAUTH
	EtCheckPING
	EtCheckVERSION
	EtCheckUSERS
)

Et-CHECK请求的类型

View Source
const (
	EtCheckUnknownTEXT = "UNKNOWN"
	EtCheckAuthTEXT    = "AUTH"
	EtCheckPingTEXT    = "PING"
	EtCheckVersionTEXT = "VERSION"
	EtCheckUsersTEXT   = "USERS"
)

ET-CHECK请求类型的文本

Variables

View Source
var ETCheckTypeTexts map[int]string

ETCheckTypeTexts ET-CHECK类型的文本

View Source
var ETCheckTypes map[string]int

ETCheckTypes ET-CHECK的类型

Functions

func CheckLocationByWeb

func CheckLocationByWeb(ip string) (string, error)

CheckLocationByWeb 外部解析IP的Location

func ParseEtCheckType

func ParseEtCheckType(src string) int

ParseEtCheckType 将字符串转换为EtCHECK请求的类型

func SendEtCheckAuthReq

func SendEtCheckAuthReq() string

SendEtCheckAuthReq 发射 ET-CHECK-AUTH 请求

func SendEtCheckPingReq

func SendEtCheckPingReq(sig chan string)

SendEtCheckPingReq 发射ET-CHECK-PING请求

func SendEtCheckUsersReq

func SendEtCheckUsersReq() (string, error)

SendEtCheckUsersReq 发射 ET-CHECK-USERS 请求

func SendEtCheckVersionReq

func SendEtCheckVersionReq() (reply string, err error)

SendEtCheckVersionReq 发射 ET-CHECK-VERSION 请求

Types

type Bind

type Bind struct {
}

Bind BIND子协议

func (Bind) Handle

func (b Bind) Handle(req string, tunnel *tunnel.Tunnel) (err error)

Handle 处理请求

func (Bind) Name

func (b Bind) Name() string

Name ET子协议的名字

func (Bind) Send

func (b Bind) Send(e *comm.NetArg) error

Send 发送请求

func (Bind) Type

func (b Bind) Type() comm.CMDType

Type 类型

type Check

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

Check Check子协议 必须使用NewCheck进行初始化

func NewCheck

func NewCheck() Check

NewCheck 初始化Check

func (Check) Handle

func (c Check) Handle(req string, t *tunnel.Tunnel) error

Handle 处理ET-Check请求

func (Check) Name

func (c Check) Name() string

Name ET子协议的名字

func (Check) Type

func (c Check) Type() comm.CMDType

Type ET子协议的类型

type DNS

type DNS struct {
	DNSType comm.CMDType

	DNSResolver func(string) (string, error) `label:"DNS解析器"`
	// contains filtered or unexported fields
}

DNS ET-DNS子协议的实现

func (*DNS) Handle

func (d *DNS) Handle(req string, t *tunnel.Tunnel) error

Handle 处理ET-DNS请求

func (*DNS) Name

func (d *DNS) Name() string

Name ET子协议的名字

func (*DNS) Send

func (d *DNS) Send(e *comm.NetArg) (err error)

Send 发送ET-DNS请求

func (*DNS) Type

func (d *DNS) Type() comm.CMDType

Type ET子协议类型

type Location

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

Location ET-LOCATION子协议的实现

func (*Location) Handle

func (l *Location) Handle(req string, t *tunnel.Tunnel) (err error)

Handle 处理ET-LOCATION请求 此方法完成缓存的读取 如果缓存不命中则进一步调用CheckLocationByWeb

func (*Location) Name

func (l *Location) Name() string

Name ET子协议的名字

func (*Location) Send

func (l *Location) Send(e *comm.NetArg) (err error)

Send 发送ET-LOCATION请求 解析IP的地理位置,结果存放于e.Reply 本方法完成缓存查询功能,查询不命中则进一步调用_Send

func (*Location) Type

func (l *Location) Type() comm.CMDType

Type ET子协议的类型

type TCP

type TCP struct {
}

TCP ET-TCP子协议的实现

func (TCP) Handle

func (t TCP) Handle(req string, tn *tunnel.Tunnel) error

Handle 处理ET-TCP请求

func (TCP) Name

func (t TCP) Name() string

Name ET子协议的名字

func (TCP) Send

func (t TCP) Send(e *comm.NetArg) (err error)

Send 发送请求

func (TCP) Type

func (t TCP) Type() comm.CMDType

Type ET子协议的类型

Jump to

Keyboard shortcuts

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