common

package
v0.0.0-...-c59634c Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTunnelInfoInvalid = errors.New("tunnel info is invalid")
)

Functions

func MarshalTunnelInfo

func MarshalTunnelInfo(tunnelInfo TunnelInfo) ([]byte, error)

Types

type Id

type Id interface {
	Raw() interface{}
	Equals(other interface{}) bool
	String() string
}

func GenerateId

func GenerateId() Id

func ParseId

func ParseId(idString string) (Id, error)

type TunnelInfo

type TunnelInfo interface {
	Id() Id
	Type() TunnelType
	EdgeServerAddr() string
	EdgeAgentAddr() string
}

func GenerateTunnelInfo

func GenerateTunnelInfo(tunnelId Id, tunnelType TunnelType, edgeServerAddr string, edgeAgentAddr string) (
	TunnelInfo, error,
)

func UnmarshalTunnelInfo

func UnmarshalTunnelInfo(data []byte) (TunnelInfo, error)

type TunnelType

type TunnelType string
const (
	TunnelTypeHttp TunnelType = "http"
	TunnelTypeTcp  TunnelType = "tcp"
	TunnelTypeUdp  TunnelType = "udp"
)

Jump to

Keyboard shortcuts

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