balance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2017 License: MPL-2.0 Imports: 14 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 Deprecated: Use `SetServices(common.GetServices())` instead

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())`)

type Nginx added in v0.1.0

type Nginx struct {
	Services []core.Service
	// contains filtered or unexported fields
}

func (*Nginx) DeleteServer added in v0.1.0

func (n *Nginx) DeleteServer(svcId, srvId string) error

DeleteServer deletes the server from the service in nginx.

func (*Nginx) DeleteService added in v0.1.0

func (n *Nginx) DeleteService(id string) error

func (Nginx) GetServer added in v0.1.0

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

GetServer gets server from the service.

func (Nginx) GetService added in v0.1.0

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

func (*Nginx) GetServices added in v0.1.0

func (n *Nginx) GetServices() ([]core.Service, error)

func (*Nginx) Init added in v0.1.0

func (n *Nginx) Init() error

func (*Nginx) SetServer added in v0.1.0

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

SetServer adds or updates the server for the service in nginx.

func (*Nginx) SetServers added in v0.1.0

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

SetServers updates the servers for the service in nginx.

func (*Nginx) SetService added in v0.1.0

func (n *Nginx) SetService(service *core.Service) error

SetService updates or adds the service

func (*Nginx) SetServices added in v0.1.0

func (n *Nginx) SetServices(services []core.Service) error

Jump to

Keyboard shortcuts

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