config

package
v0.0.0-...-5e932ec Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

View Source
const (
	UIPathPrefix      = "/dashboard/"
	APIPathPrefix     = "/dashboard/api/"
	SwaggerPathPrefix = "/dashboard/api/swagger/"
)
View Source
const (
	KeyVisualDBPolicy = "db"
	KeyVisualKVPolicy = "kv"

	DefaultKeyVisualPolicy = KeyVisualDBPolicy

	DefaultProfilingAutoCollectionDurationSecs = 30
	MaxProfilingAutoCollectionDurationSecs     = 120
	DefaultProfilingAutoCollectionIntervalSecs = 3600
)
View Source
const (
	DynamicConfigPath = "/dashboard/dynamic_config"
	Timeout           = time.Second
	MaxCheckInterval  = 30 * time.Second
	MaxElapsedTime    = 0 // never stop if MaxElapsedTime == 0
)

Variables

View Source
var (
	KeyVisualPolicies = []string{KeyVisualDBPolicy, KeyVisualKVPolicy}

	ErrVerificationFailed = ErrorNS.NewType("verification failed")
)
View Source
var (
	ErrorNS         = errorx.NewNamespace("error.dynamic_config")
	ErrUnableToLoad = ErrorNS.NewType("unable_to_load")
	ErrNotReady     = ErrorNS.NewType("not_ready")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	DataDir          string
	TempDir          string
	PDEndPoint       string
	PublicPathPrefix string

	ClusterTLSConfig *tls.Config        // TLS config for mTLS authentication between TiDB components.
	ClusterTLSInfo   *transport.TLSInfo // TLS info for mTLS authentication between TiDB components.
	TiDBTLSConfig    *tls.Config        // TLS config for mTLS authentication between TiDB and MySQL client.

	EnableTelemetry     bool
	EnableExperimental  bool
	EnableKeyVisualizer bool
	FeatureVersion      string // assign the target TiDB version when running TiDB Dashboard as standalone mode

	NgmTimeout int // in seconds
}

func Default

func Default() *Config

func (*Config) GetClusterHTTPScheme

func (c *Config) GetClusterHTTPScheme() string

func (*Config) NormalizePDEndPoint

func (c *Config) NormalizePDEndPoint() error

func (*Config) NormalizePublicPathPrefix

func (c *Config) NormalizePublicPathPrefix()

type DynamicConfig

type DynamicConfig struct {
	KeyVisual KeyVisualConfig `json:"keyvisual"`
	Profiling ProfilingConfig `json:"profiling"`
	SSO       SSOConfig       `json:"sso"`
}

func (*DynamicConfig) Adjust

func (c *DynamicConfig) Adjust()

Adjust is used to fill the default config for the existing config of the old version.

func (*DynamicConfig) Clone

func (c *DynamicConfig) Clone() *DynamicConfig

func (*DynamicConfig) Validate

func (c *DynamicConfig) Validate() error

type DynamicConfigManager

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

func NewDynamicConfigManager

func NewDynamicConfigManager(lc fx.Lifecycle, config *Config, etcdClient *clientv3.Client) *DynamicConfigManager

func (*DynamicConfigManager) Get

func (*DynamicConfigManager) Modify

func (m *DynamicConfigManager) Modify(opts ...DynamicConfigOption) error

func (*DynamicConfigManager) NewPushChannel

func (m *DynamicConfigManager) NewPushChannel() <-chan *DynamicConfig

func (*DynamicConfigManager) Set

func (m *DynamicConfigManager) Set(newDc *DynamicConfig) error

func (*DynamicConfigManager) Start

func (m *DynamicConfigManager) Start(ctx context.Context) error

func (*DynamicConfigManager) Stop

type DynamicConfigOption

type DynamicConfigOption func(dc *DynamicConfig)

type KeyVisualConfig

type KeyVisualConfig struct {
	AutoCollectionDisabled bool   `json:"auto_collection_disabled"`
	Policy                 string `json:"policy"`
	PolicyKVSeparator      string `json:"policy_kv_separator"`
}

type ProfilingConfig

type ProfilingConfig struct {
	AutoCollectionTargets      []model.RequestTargetNode `json:"auto_collection_targets"`
	AutoCollectionDurationSecs uint                      `json:"auto_collection_duration_secs"`
	AutoCollectionIntervalSecs uint                      `json:"auto_collection_interval_secs"`
}

type SSOConfig

type SSOConfig struct {
	CoreConfig  SSOCoreConfig `json:"core_config"`
	AuthURL     string        `json:"auth_url"`
	TokenURL    string        `json:"token_url"`
	UserInfoURL string        `json:"user_info_url"`
	SignOutURL  string        `json:"sign_out_url"`
}

type SSOCoreConfig

type SSOCoreConfig struct {
	Enabled      bool   `json:"enabled"`
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	DiscoveryURL string `json:"discovery_url"`
	Scopes       string `json:"scopes"`
	IsReadOnly   bool   `json:"is_read_only"`
}

Jump to

Keyboard shortcuts

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