ip2service

package
v0.0.0-...-4fbd946 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointsEventHandler

type EndpointsEventHandler struct {
	Logger                *zap.Logger
	ServiceName           string
	ServiceTargetPortName string
	Router                RouterIface
}

func (*EndpointsEventHandler) OnAdd

func (h *EndpointsEventHandler) OnAdd(obj interface{})

func (*EndpointsEventHandler) OnDelete

func (h *EndpointsEventHandler) OnDelete(obj interface{})

func (*EndpointsEventHandler) OnUpdate

func (h *EndpointsEventHandler) OnUpdate(oldObj, newObj interface{})

type IPTables

type IPTables interface {
	NewChain(table, chain string) error
	ListChains(table string) ([]string, error)
	Insert(table, chain string, pos int, rulespec ...string) error
	Append(table, chain string, rulespec ...string) error
	AppendUnique(table, chain string, rulespec ...string) error
	Delete(table, chain string, rulespec ...string) error
	List(table, chain string) ([]string, error)
	ClearChain(table, chain string) error
	DeleteChain(table, chain string) error
}

type Router

type Router struct {
	Logger        *zap.Logger
	Prefix        string
	InterceptIP   string
	InterceptPort int32
	IPTables      IPTables
}

func (*Router) EnsureRoute

func (r *Router) EnsureRoute(ip2port map[string]int32) error

type RouterIface

type RouterIface interface {
	EnsureRoute(ip2port map[string]int32) error
}

Jump to

Keyboard shortcuts

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