ipvs

package
v0.0.0-...-398fed0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NatMode    = gipvs.DFForwardMasq
	TunnelMode = gipvs.DFForwardTunnel
	RouteMode  = gipvs.DFForwardRoute
)

Variables

This section is empty.

Functions

func FromService

func FromService(s *gipvs.Service) types.Service

func ToIpvsService

func ToIpvsService(s *types.Service) *gipvs.Service

Types

type FusisState

type FusisState struct {
	Services     map[string]types.Service
	Destinations map[string]types.Destination
}

func NewFusisState

func NewFusisState() *FusisState

func (*FusisState) AddDestination

func (s *FusisState) AddDestination(dst *types.Destination)

func (*FusisState) AddService

func (s *FusisState) AddService(svc *types.Service)

func (*FusisState) CollectStats

func (s *FusisState) CollectStats(tick time.Time)

func (*FusisState) DeleteDestination

func (s *FusisState) DeleteDestination(dst *types.Destination)

func (*FusisState) DeleteService

func (s *FusisState) DeleteService(svc *types.Service)

func (*FusisState) GetDestination

func (s *FusisState) GetDestination(name string) (*types.Destination, error)

func (*FusisState) GetService

func (s *FusisState) GetService(name string) (*types.Service, error)

func (*FusisState) GetServices

func (s *FusisState) GetServices() []types.Service

type Ipvs

type Ipvs struct {
	sync.Mutex
}

func New

func New() (*Ipvs, error)

New creates a new ipvs struct and flushes the IPVS Table

func (*Ipvs) Flush

func (ipvs *Ipvs) Flush() error

Flush flushes all services and destinations from the IPVS table.

func (*Ipvs) SyncState

func (ipvs *Ipvs) SyncState(state State) error

type State

type State interface {
	GetServices() []types.Service
	GetService(name string) (*types.Service, error)
	AddService(svc *types.Service)
	DeleteService(svc *types.Service)

	GetDestination(name string) (*types.Destination, error)
	AddDestination(dst *types.Destination)
	DeleteDestination(dst *types.Destination)
	CollectStats(tick time.Time)
}

Jump to

Keyboard shortcuts

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