models

package
v0.0.0-...-d989b54 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Start   = "start"
	Stop    = "stop"
	Restart = "restart"
)
View Source
const (
	GetConfig    = "get"
	AddConfig    = "add"
	UpdateConfig = "update"
	DeleteConfig = "delete"
)
View Source
const InnerSecretKey = "D2BsaMhN4IPnsFJ8NPIki83n2f6xdC0s"
View Source
const Partner = "dashboard"

Variables

This section is empty.

Functions

func Init

func Init(keeperAddr string) error

func InitClient

func InitClient(keeper string)

Types

type BaseResponse

type BaseResponse struct {
	Code    int    `json:"error_code"`
	Message string `json:"error"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}
var KeeperAdminClient *Client

func (*Client) AddFile

func (c *Client) AddFile(cluster string, file string, confData string, note string) error

func (*Client) GetService

func (c *Client) GetService(serviceName string) (*discovery.Service, error)

func (*Client) GetServices

func (c *Client) GetServices() ([]string, error)

func (*Client) Keeper

func (c *Client) Keeper() string

func (*Client) ManageConfig

func (c *Client) ManageConfig(cluster string, ops []*km.Operate, note string) error

管理集群配置

func (*Client) ManageNode

func (c *Client) ManageNode(cluster, node, operation string) error

func (*Client) QueryClusters

func (c *Client) QueryClusters() (Clusters, error)

查询 keeper 下所有集群

func (*Client) QueryConfig

func (c *Client) QueryConfig(cluster string) ([]*conf.File, error)

查询集群配置

func (*Client) QueryHistory

func (c *Client) QueryHistory() error

func (*Client) QueryNodeInfo

func (c *Client) QueryNodeInfo(cluster, node string) error

查询集群结点信息

func (*Client) QueryNodeList

func (c *Client) QueryNodeList(cluster, component string) ([]*km.NodeInfo, error)

查询集群所有结点

func (*Client) QueryNodeStatus

func (c *Client) QueryNodeStatus() error

node status

func (*Client) ReloadConfig

func (c *Client) ReloadConfig(cluster string) error

func (*Client) RollbackConfig

func (c *Client) RollbackConfig(cluster string, id int64) error

type Clusters

type Clusters []*kd.Domain

func (Clusters) Len

func (s Clusters) Len() int

func (Clusters) Less

func (s Clusters) Less(i, j int) bool

func (Clusters) Swap

func (s Clusters) Swap(i, j int)

type GetServiceResp

type GetServiceResp struct {
	Error     string            `json:"error"`
	ErrorCode int               `json:"error_code"`
	Data      discovery.Service `json:"data"`
}

type GetServicesResp

type GetServicesResp struct {
	Error     string   `json:"error"`
	ErrorCode int      `json:"error_code"`
	Data      []string `json:"data"`
}

type QueryClustersResp

type QueryClustersResp struct {
	BaseResponse
	Data Clusters `json:"data"`
}

type QueryConfigResp

type QueryConfigResp struct {
	BaseResponse
	Data []*conf.File `json:"data"`
}

type QueryNodeListResp

type QueryNodeListResp struct {
	BaseResponse
	Data []*km.NodeInfo `json:"data"`
}

Jump to

Keyboard shortcuts

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