intercept

package
v0.16.7 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterceptAddress

func NewInterceptAddress(service *entities.Service, protocol string, resolver dns.Resolver) (*interceptAddress, error)

func ServicePoller

func ServicePoller(context ziti.Context, interceptor Interceptor, resolver dns.Resolver, pollRate time.Duration)

Types

type InterceptedService

type InterceptedService struct {
	Name string
	Addr interceptAddress
	Data interface{} // interceptor-specific data attached to this intercept. intent is to provide context needed in Interceptor.StopIntercepting
}

type Interceptor

type Interceptor interface {
	Start(context ziti.Context)
	Stop()
	Intercept(service *entities.Service, resolver dns.Resolver) error
	StopIntercepting(serviceName string, removeRoute bool) error
}

type LUT

type LUT map[interceptAddress]InterceptedService

func NewLUT

func NewLUT() LUT

func (LUT) GetByAddress

func (m LUT) GetByAddress(addr net.Addr) (*InterceptedService, error)

Return the service that is being intercepted at the given address, if any.

func (LUT) GetByName

func (m LUT) GetByName(serviceName string) []InterceptedService

func (LUT) Put

func (m LUT) Put(addr interceptAddress, serviceName string, data interface{}) error

func (LUT) Remove

func (m LUT) Remove(interceptAddr interceptAddress)

type Protocol

type Protocol int
const (
	TCP Protocol = 2
	UDP Protocol = 17
)

Directories

Path Synopsis
ip
tcp
udp

Jump to

Keyboard shortcuts

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