database

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	// contains filtered or unexported fields
}

func NewMySQL

func NewMySQL() (*MySQL, error)

func (*MySQL) AddHost

func (r *MySQL) AddHost(host network.HostParam) (hostID uint64, err error)

func (*MySQL) AddNetwork

func (r *MySQL) AddNetwork(addr net.IP, mask net.IPMask) (netID uint64, err error)

func (*MySQL) AddSwitch

func (r *MySQL) AddSwitch(sw network.SwitchParam) (swID uint64, err error)

func (*MySQL) AddVIP

func (r *MySQL) AddVIP(vip network.VIPParam) (id uint64, cidr string, err error)

func (*MySQL) Elect added in v0.13.0

func (r *MySQL) Elect(uid string, expiration time.Duration) (elected bool, err error)

Elect selects a new master as uid if there is a no existing master that has been updated within expiration. elected will be true if this uid has been elected as the new master or was already elected.

func (*MySQL) GetActivatedHosts added in v0.13.0

func (r *MySQL) GetActivatedHosts() (hosts []proxyarp.Host, err error)

func (*MySQL) GetActivatedVIPs added in v0.13.0

func (r *MySQL) GetActivatedVIPs() (result []virtualip.Address, err error)

func (*MySQL) GetUndiscoveredHosts added in v0.13.0

func (r *MySQL) GetUndiscoveredHosts(expiration time.Duration) (result []net.IP, err error)

GetUndiscoveredHosts returns IP addresses whose physical location is still undiscovered or staled more than expiration. result can be nil on empty result.

func (*MySQL) Host

func (r *MySQL) Host(id uint64) (host network.Host, ok bool, err error)

func (*MySQL) Hosts

func (r *MySQL) Hosts() (hosts []network.Host, err error)

func (*MySQL) IPAddrs

func (r *MySQL) IPAddrs(networkID uint64) (addresses []network.IP, err error)

func (*MySQL) Location

func (r *MySQL) Location(mac net.HardwareAddr) (dpid string, port uint32, status network.LocationStatus, err error)

func (*MySQL) MAC

func (r *MySQL) MAC(ip net.IP) (mac net.HardwareAddr, ok bool, err error)

func (*MySQL) MACAddrs added in v0.13.0

func (r *MySQL) MACAddrs() (result []net.HardwareAddr, err error)

MACAddrs returns all the registered MAC addresses.

func (*MySQL) Network

func (r *MySQL) Network(addr net.IP) (n network.Network, ok bool, err error)

func (*MySQL) Networks

func (r *MySQL) Networks() (networks []network.Network, err error)

func (*MySQL) RemoveHost

func (r *MySQL) RemoveHost(id uint64) (ok bool, err error)

func (*MySQL) RemoveNetwork

func (r *MySQL) RemoveNetwork(id uint64) (ok bool, err error)

func (*MySQL) RemoveSwitch

func (r *MySQL) RemoveSwitch(id uint64) (ok bool, err error)

func (*MySQL) RemoveVIP

func (r *MySQL) RemoveVIP(id uint64) (ok bool, err error)

func (*MySQL) ResetHostLocationsByDevice added in v0.13.0

func (r *MySQL) ResetHostLocationsByDevice(swDPID uint64) error

ResetHostLocationsByDevice sets NULL to the host locations that belong to the device specified by swDPID.

func (*MySQL) ResetHostLocationsByPort added in v0.13.0

func (r *MySQL) ResetHostLocationsByPort(swDPID uint64, portNum uint16) error

ResetHostLocationsByPort sets NULL to the host locations that belong to the port specified by swDPID and portNum.

func (*MySQL) Switch

func (r *MySQL) Switch(dpid uint64) (sw network.Switch, ok bool, err error)

func (*MySQL) SwitchPorts

func (r *MySQL) SwitchPorts(swID uint64) (ports []network.SwitchPort, err error)

func (*MySQL) Switches

func (r *MySQL) Switches() (sw []network.Switch, err error)

func (*MySQL) ToggleDeviceVIP

func (r *MySQL) ToggleDeviceVIP(swDPID uint64) (result []virtualip.Address, err error)

func (*MySQL) TogglePortVIP

func (r *MySQL) TogglePortVIP(swDPID uint64, portNum uint16) (result []virtualip.Address, err error)

func (*MySQL) ToggleVIP

func (r *MySQL) ToggleVIP(id uint64) (ip net.IP, mac net.HardwareAddr, err error)

func (*MySQL) UpdateHostLocation added in v0.13.0

func (r *MySQL) UpdateHostLocation(mac net.HardwareAddr, ip net.IP, swDPID uint64, portNum uint16) (updated bool, err error)

UpdateHostLocation updates the physical location of a host, whose MAC and IP addresses are matched with mac and ip, to the port identified by swDPID and portNum. updated will be true if its location has been actually updated.

func (*MySQL) VIPs

func (r *MySQL) VIPs() (result []network.VIP, err error)

Jump to

Keyboard shortcuts

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