handler

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Overview

维护集群配置信息

维护命名空间信息

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSvcDnsAR

func AddSvcDnsAR(w http.ResponseWriter, r *http.Request)

AddSvcDnsAR 增加指定服务的A记录

func GetClusterInfo

func GetClusterInfo(w http.ResponseWriter, r *http.Request)

func QueryClusterInfo

func QueryClusterInfo(w http.ResponseWriter, r *http.Request)

QueryClusterInfo 更新集群列表信息 列出此账户下所有的集群信息

func QueryNameSpace

func QueryNameSpace(w http.ResponseWriter, r *http.Request)

func QueryNamespaceByName

func QueryNamespaceByName(w http.ResponseWriter, r *http.Request)

func QueryService

func QueryService(w http.ResponseWriter, r *http.Request)

Types

type Cluster

type Cluster struct {
	SecretId  string `json:"secret_id"`
	SecretKey string `json:"secret_key"`
	Region    string `json:"region"`
}

func (Cluster) SaveClusterInfo

func (this Cluster) SaveClusterInfo(save bool) (*cvm.ClusterInfo, error)

saveClusterInfo 查询集群信息并持久化到etcd 如果选择持久化,则会覆盖旧值

type NameSpace

type NameSpace struct {
	SecretId  string `json:"secret_id"`
	SecretKey string `json:"secret_key"`
	Region    string `json:"region"`
	ClusterID string `json:"cluster_id"`
}

func (NameSpace) SaveNSInfo

func (this NameSpace) SaveNSInfo(save bool) (*ns.NSInfo, error)

type Svc

type Svc struct {
	Svcname      string `json:"svcname"`
	SecretId     string `json:"secret_id"`
	SecretKey    string `json:"secret_key"`
	Region       string `json:"region"`
	Clusterid    string `json:"clusterid"`
	Namespace    string `json:"namespace"`
	Allnamespace string `json:"allnamespace"`

	Domain string `json:"domain"`
	// contains filtered or unexported fields
}

func (Svc) ChangeDns

func (this Svc) ChangeDns() (bool, error)

ChangeDns 修改指定服务名称的DNS记录 当前支持修改A记录,如果修改成功则返回True, 如果找不到指定的服务名称则返回False 如果出现其他错误,则返回error

func (Svc) WatchDNS

func (this Svc) WatchDNS() error

WatchDNS 维护服务名称与DNS的对应关系 例如: 服务名称为: user-manager-domain-com 将转换为: /com/domain/manager/user 实际在DNS中对应的域名为 user.manager.domain.com

Jump to

Keyboard shortcuts

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