tunnel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DestinationProtocolKey = "dst_protocol"
	DestinationHostname    = "dst_hostname"
	DestinationIpKey       = "dst_ip"
	DestinationPortKey     = "dst_port"
	SourceAddrKey          = "source_addr"

	SourceIpKey   = "src_ip"
	SourcePortKey = "src_port"
)

Variables

This section is empty.

Functions

func AppDataToMap

func AppDataToMap(appData []byte) (map[string]interface{}, error)

func DialAndRun

func DialAndRun(service Service, instanceId string, clientConn net.Conn, appInfo map[string]string, halfClose bool)

func GetAppInfo

func GetAppInfo(protocol, dstHostname, dstIp, dstPort, sourceAddr string) map[string]string

func GetIpAndPort

func GetIpAndPort(addr net.Addr) (string, string)

func Run

func Run(zitiConn net.Conn, clientConn net.Conn, halfClose bool)

Types

type FabricProvider

type FabricProvider interface {
	PrepForUse(serviceId string)
	GetCurrentIdentity() (*rest_model.IdentityDetail, error)
	GetCurrentIdentityWithBackoff() (*rest_model.IdentityDetail, error)
	TunnelService(service Service, identity string, conn net.Conn, halfClose bool, appInfo []byte) error
	HostService(hostCtx HostingContext) (HostControl, error)
}

func NewContextProvider

func NewContextProvider(context ziti.Context) FabricProvider

type HostControl

type HostControl interface {
	io.Closer
	UpdateCost(cost uint16) error
	UpdatePrecedence(precedence edge.Precedence) error
	UpdateCostAndPrecedence(cost uint16, precedence edge.Precedence) error
	SendHealthEvent(pass bool) error
}

type HostingContext

type HostingContext interface {
	ServiceName() string
	ListenOptions() *ziti.ListenOptions
	Dial(options map[string]interface{}) (net.Conn, bool, error)
	GetHealthChecks() []health.CheckDefinition
	GetInitialHealthState() (ziti.Precedence, uint16)
	OnClose()
	SetCloseCallback(func())
}

type Service

type Service interface {
	GetFabricProvider() FabricProvider
	GetName() string
	GetDialTimeout() time.Duration
	IsEncryptionRequired() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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