Documentation ¶
Index ¶
- Variables
- func RegisterMetrics(addr string)
- type Allocator
- func (allo *Allocator) Add(request *restful.Request, response *restful.Response)
- func (allo *Allocator) Delete(request *restful.Request, response *restful.Response)
- func (allo *Allocator) HostVIPRelease(request *restful.Request, response *restful.Response)
- func (allo *Allocator) List(request *restful.Request, response *restful.Response)
- func (allo *Allocator) Update(request *restful.Request, response *restful.Response)
- type HTTPService
- type HostHandler
- func (host *HostHandler) Add(request *restful.Request, response *restful.Response)
- func (host *HostHandler) Delete(request *restful.Request, response *restful.Response)
- func (host *HostHandler) List(request *restful.Request, response *restful.Response)
- func (host *HostHandler) ListByID(request *restful.Request, response *restful.Response)
- func (host *HostHandler) Update(request *restful.Request, response *restful.Response)
- type IPInstanceHandler
- type PoolHandler
- func (pool *PoolHandler) Add(request *restful.Request, response *restful.Response)
- func (pool *PoolHandler) Delete(request *restful.Request, response *restful.Response)
- func (pool *PoolHandler) List(request *restful.Request, response *restful.Response)
- func (pool *PoolHandler) ListByID(request *restful.Request, response *restful.Response)
- func (pool *PoolHandler) Query(request *restful.Request, response *restful.Response)
- func (pool *PoolHandler) Update(request *restful.Request, response *restful.Response)
- type ResourceHandler
Constants ¶
This section is empty.
Variables ¶
var (
// SUCCESS success string for response
SUCCESS = "success"
)
Functions ¶
func RegisterMetrics ¶
func RegisterMetrics(addr string)
RegisterMetrics register http metrics for netservice
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
Allocator ip resource lean & release
func RegisterAllocator ¶
func RegisterAllocator(httpSvr *HTTPService, logic *netservice.NetService) *Allocator
RegisterAllocator ip resource allocation
func (*Allocator) HostVIPRelease ¶
HostVIPRelease release all the vip in the host
type HTTPService ¶
type HTTPService struct {
// contains filtered or unexported fields
}
HTTPService http container for register api for net-service
func NewHTTPService ¶
func NewHTTPService(addr string, port int) *HTTPService
NewHTTPService create http service for net-service
func (*HTTPService) ListenAndServe ¶
func (svr *HTTPService) ListenAndServe() error
ListenAndServe http listen
func (*HTTPService) ListenAndServeTLS ¶
func (svr *HTTPService) ListenAndServeTLS(certFile, keyFile, pubFile, passwd string) error
ListenAndServeTLS https listen param certFile: root ca cert param keyFile: http server private key file param pubFile: http server public key file param passwd: if private key encrypted, passwd required
func (*HTTPService) Register ¶
func (svr *HTTPService) Register(wb *restful.WebService)
Register register restful web service
type HostHandler ¶
type HostHandler struct {
// contains filtered or unexported fields
}
HostHandler for http host handler
func RegisterHostHandler ¶
func RegisterHostHandler(httpSvr *HTTPService, logic *netservice.NetService) *HostHandler
RegisterHostHandler init host url info
func (*HostHandler) Add ¶
func (host *HostHandler) Add(request *restful.Request, response *restful.Response)
Add add host to ip pool
func (*HostHandler) Delete ¶
func (host *HostHandler) Delete(request *restful.Request, response *restful.Response)
Delete delete specified by host IPaddress, also clean IPAddress assign to this host
func (*HostHandler) List ¶
func (host *HostHandler) List(request *restful.Request, response *restful.Response)
List list all pools
type IPInstanceHandler ¶
type IPInstanceHandler struct {
// contains filtered or unexported fields
}
IPInstanceHandler http request handler
func RegisterIPInstanceHandler ¶
func RegisterIPInstanceHandler(httpSvr *HTTPService, logic *netservice.NetService) *IPInstanceHandler
RegisterIPInstanceHandler create pool handler, url link : v1/ipinstanace
func (*IPInstanceHandler) TransferIPAttr ¶
func (inst *IPInstanceHandler) TransferIPAttr(request *restful.Request, response *restful.Response)
TransferIPAttr transfer ip attr from available/reserved to reserved/available
type PoolHandler ¶
type PoolHandler struct {
// contains filtered or unexported fields
}
PoolHandler http request handler
func RegisterPoolHandler ¶
func RegisterPoolHandler(httpSvr *HTTPService, logic *netservice.NetService) *PoolHandler
RegisterPoolHandler create pool handler, url link : v1/pool
func (*PoolHandler) Add ¶
func (pool *PoolHandler) Add(request *restful.Request, response *restful.Response)
Add add new pool
func (*PoolHandler) Delete ¶
func (pool *PoolHandler) Delete(request *restful.Request, response *restful.Response)
Delete delete pool by ip segment
func (*PoolHandler) List ¶
func (pool *PoolHandler) List(request *restful.Request, response *restful.Response)
List list all pools
func (*PoolHandler) ListByID ¶
func (pool *PoolHandler) ListByID(request *restful.Request, response *restful.Response)
ListByID list all pools
type ResourceHandler ¶
type ResourceHandler struct {
// contains filtered or unexported fields
}
ResourceHandler for http host handler
func RegisterResourceHandler ¶
func RegisterResourceHandler(httpSvr *HTTPService, logic *netservice.NetService) *ResourceHandler
RegisterResourceHandler init host url info