models

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: MIT Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetToken

func GetToken(gatewayConfig GatewayConfig, permission int, expiresecd int64) (token string, err error)

Types

type CheckStatusRequest

type CheckStatusRequest struct {
	Type string
	Addr string
}

type CheckStatusResponse

type CheckStatusResponse struct {
	//Code:0:在线;1:离线
	Code    int
	Message string
}

type ConnectSSH

type ConnectSSH struct {
	TargetIP   string
	TargetPort int
	UserName   string
	PassWord   string
}

type ConnectSTCP

type ConnectSTCP struct {
	TargetIP   string
	TargetPort int
}

type ConnectSerialPort

type ConnectSerialPort serial.OpenOptions

type ConnectTCP

type ConnectTCP struct {
	TargetIP   string
	TargetPort int
}

connect //tcp,stcp,udp,serialport,ws,wss

type ConnectUDP

type ConnectUDP struct {
	TargetIP   string
	TargetPort int
}

type ConnectWs

type ConnectWs struct {
	TargetUrl string
	Protocol  string
	Origin    string
}

type ConnectWss

type ConnectWss struct {
	TargetUrl string
	Protocol  string
	Origin    string
}

type Error

type Error struct {
	Code    int
	Message string
}

type FindmDNS

type FindmDNS struct {
	Service string
	Domain  string
	Second  int
}

type GatewayConfig

type GatewayConfig struct {
	ConnectionType        string `yaml:"connection_type"`
	LastId                string `yaml:"last_id"`
	ExplorerTokenHttpPort int    `yaml:"http_api_port"`
	Server                Srever
}

type GatewayLogin

type GatewayLogin struct {
	Token string
	Os    string
	Arch  string
}

login

type GatewayWorkConn

type GatewayWorkConn struct {
	RunId  string
	Secret string
}

type GetMyUDPPublicAddr

type GetMyUDPPublicAddr struct{}

type InstallPlugin

type InstallPlugin struct {
	TargetUrl string
}

/plugin

type JsonResponse

type JsonResponse struct {
	Code   int
	Msg    string
	Result string
}

type MDNSResult

type MDNSResult []*zeroconf.ServiceEntry

type Message

type Message interface{}

type Msg

type Msg struct {
	MsgType    string
	MsgContent string
}

type NewService

type NewService struct {
	Type   string
	Config string
}

type NewSubSession

type NewSubSession struct{}

type OK

type OK struct{}

type OpenIoTHubLogin

type OpenIoTHubLogin struct {
	Token string
	Os    string
	Arch  string
}

Connect TO

type Ping

type Ping struct{}

/Ping

type Pong

type Pong struct{}

type QueryInstalledPlugin

type QueryInstalledPlugin struct{}

/query installed plugin

type RemoteNetInfo

type RemoteNetInfo struct {
	IntranetIp   string
	IntranetPort int
	ExternalIp   string
	ExternalPort int
}

TODO:NETINFO Model

type RemovePlugin

type RemovePlugin struct {
	TargetUrl string
}

type ReqNewP2PCtrlAsClient

type ReqNewP2PCtrlAsClient struct {
	IntranetIp   string
	IntranetPort int
	ExternalIp   string
	ExternalPort int
}

让内网端以dial的身份连接我

type ReqNewP2PCtrlAsServer added in v0.0.6

type ReqNewP2PCtrlAsServer struct {
	IntranetIp   string
	IntranetPort int
	ExternalIp   string
	ExternalPort int
}

P2P让远端以listener身份运行

type RequestNewWorkConn

type RequestNewWorkConn struct {
	Type   string
	Config string
}

type RespInstalledPlugin

type RespInstalledPlugin struct{}

type RunPlugin

type RunPlugin struct {
	TargetUrl string
}

type ScanPort

type ScanPort struct {
	Host      string
	StartPort int
	EndPort   int
}

type ScanPortResult

type ScanPortResult []int

type ServerConfig

type ServerConfig struct {
	Common struct {
		BindAddr   string `yaml:"bind_addr"`
		TcpPort    int    `yaml:"tcp_port"`
		KcpPort    int    `yaml:"kcp_port"`
		UdpApiPort int    `yaml:"udp_p2p_port"`
		KcpApiPort int    `yaml:"kcp_p2p_port"`
		TlsPort    int    `yaml:"tls_port"`
		GrpcPort   int    `yaml:"grpc_port"`
		HttpPort   int    `yaml:"http_port"`
		HttpsPort  int    `yaml:"https_port"`
	}
	Security struct {
		LoginKey          string `yaml:"login_key"`
		TlsCertFilePath   string `yaml:"tls_Cert_file_path"`
		TlsKeyFilePath    string `yaml:"tls_key_file_path"`
		HttpsCertFilePath string `yaml:"https_cert_file_path"`
		HttpsKeyFilePath  string `yaml:"https_key_file_path"`
	}
}

type Srever

type Srever struct {
	ServerHost string `yaml:"server_host"`
	TcpPort    int    `yaml:"tcp_port"`
	KcpPort    int    `yaml:"kcp_port"`
	UdpApiPort int    `yaml:"udp_p2p_port"`
	KcpApiPort int    `yaml:"kcp_p2p_port"`
	TlsPort    int    `yaml:"tls_port"`
	GrpcPort   int    `yaml:"grpc_port"`
	LoginKey   string `yaml:"login_key"`
}

type StopPlugin

type StopPlugin struct {
	TargetUrl string
}

type TokenClaims

type TokenClaims struct {
	RunId      string
	Host       string
	TcpPort    int
	KcpPort    int
	TlsPort    int
	GrpcPort   int
	UDPApiPort int
	KCPApiPort int
	Permission int
	jwt.StandardClaims
}

func DecodeToken

func DecodeToken(salt, tokenStr string) (*TokenClaims, error)

func DecodeUnverifiedToken

func DecodeUnverifiedToken(tokenStr string) (*TokenClaims, error)

type UpgradePlugin

type UpgradePlugin struct {
	TargetUrl string
}

Jump to

Keyboard shortcuts

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