Documentation
¶
Index ¶
- Variables
- func Clear() error
- func Load() error
- func Restore(services []Service) error
- func Save() error
- func SetTimeouts() error
- func StartDaemon() (error, error)
- func StopDaemon() (error, error)
- func Zero() error
- type FromJson
- type Ipvs
- func (i *Ipvs) AddService(service Service) error
- func (i *Ipvs) Clear() error
- func (i *Ipvs) EditService(service Service) error
- func (i Ipvs) FindService(netType, host string, port int) *Service
- func (i *Ipvs) RemoveService(netType, host string, port int) error
- func (i *Ipvs) Restore(services []Service) error
- func (i *Ipvs) Save() error
- func (i Ipvs) SetTimeouts() error
- func (i Ipvs) StartDaemon() (error, error)
- func (i Ipvs) StopDaemon() (error, error)
- func (i Ipvs) Zero() error
- type Server
- type Service
- func (s Service) Add() error
- func (s *Service) AddServer(server Server) error
- func (s *Service) EditServer(server Server) error
- func (s Service) FindServer(host string, port int) *Server
- func (s *Service) FromJson(bytes []byte) error
- func (s Service) Remove() error
- func (s *Service) RemoveServer(host string, port int) error
- func (s Service) String() string
- func (s Service) ToJson() ([]byte, error)
- func (s Service) Validate() error
- func (s Service) Zero() error
- type ToJson
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Conflict = errors.New("object already exists") NotFound = errors.New("object was not found") DeleteFailed = errors.New("object was not deleted") IpvsadmMissing = errors.New("unable to find the ipvsadm command on the system") )
View Source
var ( EOFError = errors.New("ipvsadm terminated prematurely") UnexpecedToken = errors.New("Unexpected Token") )
View Source
var ( ServerForwarderFlag = map[string]string{ "g": "-g", "i": "-i", "m": "-m", "": "-g", } InvalidServerForwarder = errors.New("Invalid Server Forwarder") InvalidServerPort = errors.New("Invalid Server Port for Forwarder") )
View Source
var ( ServiceTypeFlag = map[string]string{ "tcp": "-t", "udp": "-u", "fwmark": "-f", "": "-t", } ServiceSchedulerFlag = map[string]string{ "rr": "rr", "wrr": "wrr", "lc": "lc", "wlc": "wlc", "lblc": "lblc", "lblcr": "lblcr", "dh": "dh", "sh": "sh", "sed": "sed", "nq": "nq", "": "wlc", } InvalidServiceType = errors.New("Invalid Service Type") InvalidServiceScheduler = errors.New("Invalid Service Scheduler") )
View Source
var (
DefaultIpvs = &Ipvs{}
)
Functions ¶
func Load ¶
func Load() error
Load verifies that lvs can be used, and populates it with values from the backup file
func SetTimeouts ¶
func SetTimeouts() error
func StartDaemon ¶
func StopDaemon ¶
Types ¶
type Ipvs ¶
type Ipvs struct { MulticastInterface string `json:mcast_interface` Syncid int `json:syncid` Tcp int `json:tcp_timeout` Tcpfin int `json:tcp_fin_timeout` Udp int `json:udp_fin_timeout` Services []Service `json:services` }
func (*Ipvs) AddService ¶
func (*Ipvs) EditService ¶
func (Ipvs) SetTimeouts ¶
func (Ipvs) StartDaemon ¶
func (Ipvs) StopDaemon ¶
type Server ¶
Click to show internal directories.
Click to hide internal directories.