configuration

package
v0.0.0-...-47e18b9 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNS                    = errorx.NewNamespace("error.api.config")
	ErrListTopologyFailed    = ErrNS.NewType("list_topology_failed")
	ErrListConfigItemsFailed = ErrNS.NewType("list_config_items_failed")
	ErrNotEditable           = ErrNS.NewType("not_editable")
	ErrEditFailed            = ErrNS.NewType("edit_failed")
)

Functions

func RegisterRouter

func RegisterRouter(r *gin.RouterGroup, auth *user.AuthService, s *Service)

Types

type AllConfigItems

type AllConfigItems struct {
	Errors []*utils.APIError   `json:"errors"`
	Items  map[ItemKind][]Item `json:"items"`
}

type EditRequest

type EditRequest struct {
	Kind     ItemKind    `json:"kind"`
	ID       string      `json:"id"`
	NewValue interface{} `json:"new_value"`
}

type EditResponse

type EditResponse struct {
	Warnings []*utils.APIError `json:"warnings"`
}

type Item

type Item struct {
	ID           string      `json:"id"`
	IsEditable   bool        `json:"is_editable"`
	IsMultiValue bool        `json:"is_multi_value"` // TODO: Support per-instance config
	Value        interface{} `json:"value"`          // When multi value present, this contains one of the value
}

type ItemKind

type ItemKind string
const (
	ItemKindTiKVConfig   ItemKind = "tikv_config"
	ItemKindPDConfig     ItemKind = "pd_config"
	ItemKindTiDBConfig   ItemKind = "tidb_config"
	ItemKindTiDBVariable ItemKind = "tidb_variable"
)

type Service

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

func NewService

func NewService(lc fx.Lifecycle, p ServiceParams) *Service

type ServiceParams

type ServiceParams struct {
	fx.In
	Config     *config.Config
	PDClient   *pd.Client
	EtcdClient *clientv3.Client
	TiDBClient *tidb.Client
	TiKVClient *tikv.Client
}

type ShowVariableItem

type ShowVariableItem struct {
	Name  string `gorm:"column:Variable_name"`
	Value string `gorm:"column:Value"`
}

Jump to

Keyboard shortcuts

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