示例#1
0
文件: vip.go 项目: nanopack/portal
// List the vips registered in my system
func getVips(rw http.ResponseWriter, req *http.Request) {
	vips, err := common.GetVips()
	if err != nil {
		writeError(rw, req, err, http.StatusInternalServerError)
		return
	}
	writeBody(rw, req, vips, http.StatusOK)
}
示例#2
0
文件: none.go 项目: nanopack/portal
func (n None) Init() error {
	// load services
	services, err := common.GetServices()
	if err != nil {
		return err
	}
	// apply services
	err = common.SetServices(services)
	if err != nil {
		return err
	}

	// load routes
	routes, err := common.GetRoutes()
	if err != nil {
		return err
	}
	// apply routes
	err = common.SetRoutes(routes)
	if err != nil {
		return err
	}

	// load certs
	certs, err := common.GetCerts()
	if err != nil {
		return err
	}
	// apply certs
	err = common.SetCerts(certs)
	if err != nil {
		return err
	}

	// load vips
	vips, err := common.GetVips()
	if err != nil {
		return err
	}
	// apply vips
	err = common.SetVips(vips)
	if err != nil {
		return err
	}
	return nil
}
示例#3
0
文件: none.go 项目: nanopack/portal
func (n None) GetVips() ([]core.Vip, error) {
	return common.GetVips()
}
示例#4
0
文件: redis.go 项目: nanopack/portal
func (r Redis) GetVips() ([]core.Vip, error) {
	return common.GetVips()
}