balance

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2016 License: MPL-2.0 Imports: 9 Imported by: 3

Documentation

Overview

balance handles the load balancing portion of portal.

Index

Constants

This section is empty.

Variables

View Source
var (
	Balancer       core.Backender
	NoServiceError = errors.New("No Service Found")
	NoServerError  = errors.New("No Server Found")
)

Functions

func DeleteServer

func DeleteServer(svcId, srvId string) error

func DeleteService

func DeleteService(id string) error

func GetServer

func GetServer(svcId, srvId string) (*core.Server, error)

func GetService

func GetService(id string) (*core.Service, error)

func GetServices

func GetServices() ([]core.Service, error)

func Init

func Init() error

func SetServer

func SetServer(svcId string, server *core.Server) error

func SetServers

func SetServers(svcId string, servers []core.Server) error

func SetService

func SetService(service *core.Service) error

func SetServices

func SetServices(services []core.Service) error

func Sync

func Sync() error

Sync - takes applies ipvsadm rules and save them to lvs.DefaultIpvs.Services which should already have the same information func (l *Lvs) Sync() error {

Types

type Lvs

type Lvs struct {
}

func (*Lvs) DeleteServer

func (l *Lvs) DeleteServer(svcId, srvId string) error

DeleteServer

func (*Lvs) DeleteService

func (l *Lvs) DeleteService(id string) error

DeleteService

func (*Lvs) GetServer

func (l *Lvs) GetServer(svcId, srvId string) (*core.Server, error)

GetServer

func (*Lvs) GetService

func (l *Lvs) GetService(id string) (*core.Service, error)

GetService

func (*Lvs) GetServices

func (l *Lvs) GetServices() ([]core.Service, error)

GetServices doesn't need to be a pointer method because it doesn't modify original object

func (*Lvs) Init

func (l *Lvs) Init() error

func (*Lvs) SetServer

func (l *Lvs) SetServer(svcId string, server *core.Server) error

SetServer

func (*Lvs) SetServers

func (l *Lvs) SetServers(svcId string, servers []core.Server) error

SetServers

func (*Lvs) SetService

func (l *Lvs) SetService(service *core.Service) error

SetService

func (*Lvs) SetServices

func (l *Lvs) SetServices(services []core.Service) error

SetServices used also to sync to core (`SetServices(core.GetServices())`)

Jump to

Keyboard shortcuts

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