netservice

package
v1.20.11 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetNode

type NetNode struct {
	Addr string `json:"addr"`
	Port int    `json:"port"`
}

NetNode node data for

type NetService

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

NetService service for all logic, this NetService add/delete/update/list all data base on key/value todo(DeveloperJim): if we need to store data in SQL system, NetService needs refactor.

func NewNetService

func NewNetService(addr string, port, metricPort int, st storage.Storage) *NetService

NewNetService create netservice logic

func (*NetService) AddHost

func (srv *NetService) AddHost(info *types.HostInfo) error

AddHost update host info

func (*NetService) AddPool

func (srv *NetService) AddPool(pool *types.NetPool) error

AddPool construct pool info

func (*NetService) DeleteHost

func (srv *NetService) DeleteHost(hostIP string, ipsDel []string) error

DeleteHost update host info

func (*NetService) DeletePool

func (srv *NetService) DeletePool(netKey string) error

DeletePool update Pool info

func (*NetService) GetHostInfo

func (srv *NetService) GetHostInfo(ip string) (*types.HostInfo, error)

GetHostInfo get host node content info, container info are exclude note: if err is nil & HostInfo is nil, no hostInfo in storage

func (*NetService) GetPoolAvailable

func (srv *NetService) GetPoolAvailable(net string) (*types.NetPool, error)

GetPoolAvailable get pool available ip list only

func (*NetService) HostVIPRelease

func (srv *NetService) HostVIPRelease(hostIP string) error

HostVIPRelease to release host's vip

func (*NetService) IPLean

func (srv *NetService) IPLean(lease *types.IPLease) (*types.IPInfo, error)

IPLean lease ip address from net

func (*NetService) IPRelease

func (srv *NetService) IPRelease(release *types.IPRelease) error

IPRelease release ip resource to net pool

func (*NetService) ListHost

func (srv *NetService) ListHost() ([]*types.HostInfo, error)

ListHost list all host info

func (*NetService) ListHostByKey

func (srv *NetService) ListHostByKey(ip string) (*types.HostInfo, error)

ListHostByKey list host by ip

func (*NetService) ListPool

func (srv *NetService) ListPool() ([]*types.NetPool, error)

ListPool update Pool info

func (*NetService) ListPoolByCluster

func (srv *NetService) ListPoolByCluster(cluster string) ([]*types.NetPool, error)

ListPoolByCluster list all pool under cluster

func (*NetService) ListPoolByKey

func (srv *NetService) ListPoolByKey(net string) (*types.NetPool, error)

ListPoolByKey Get pool info by net

func (*NetService) TransferIPAttribute

func (srv *NetService) TransferIPAttribute(tranInput *types.TranIPAttrInput) (int, error)

TransferIPAttribute change IP status

func (*NetService) UpdateAvailableIPInstance

func (srv *NetService) UpdateAvailableIPInstance(ipinst *types.IPInst) error

UpdateAvailableIPInstance update ip instance info. only support: MacAddress, App

func (*NetService) UpdateHost

func (srv *NetService) UpdateHost() error

UpdateHost update host info

func (*NetService) UpdatePool

func (srv *NetService) UpdatePool(pool *types.NetPool, netKey string) error

UpdatePool update Pool info

Jump to

Keyboard shortcuts

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