config

package
v0.0.0-...-97dd610 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const MockProviderConf = "./conf/mock_provider.yml"

Variables

View Source
var (
	Governance           GovernanceConfig
	RegistryCenter       registry.Registry
	MetadataReportCenter report.MetadataReport

	DataBase *gorm.DB // for service mock
)
View Source
var (
	PrometheusIp   string
	PrometheusPort string
)

Functions

func LoadConfig

func LoadConfig()

Types

type AddressConfig

type AddressConfig struct {
	Address string `yaml:"address"`
	// contains filtered or unexported fields
}

func (*AddressConfig) GetUrlMap

func (c *AddressConfig) GetUrlMap() url.Values

type Admin

type Admin struct {
	ConfigCenter   string        `yaml:"config-center"`
	MetadataReport AddressConfig `yaml:"metadata-report"`
	Registry       AddressConfig `yaml:"registry"`
	MysqlDsn       string        `yaml:"mysql-dsn"`
}

type Config

type Config struct {
	Admin      Admin      `yaml:"admin"`
	Prometheus Prometheus `yaml:"prometheus"`
}

type GovernanceConfig

type GovernanceConfig interface {
	SetConfig(key string, value string) error
	GetConfig(key string) (string, error)
	DeleteConfig(key string) error
	SetConfigWithGroup(group string, key string, value string) error
	GetConfigWithGroup(group string, key string) (string, error)
	DeleteConfigWithGroup(group string, key string) error
	Register(url *common.URL) error
	UnRegister(url *common.URL) error
	GetList(group string) (map[string]string, error)
}

type GovernanceConfigImpl

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

func (*GovernanceConfigImpl) DeleteConfig

func (g *GovernanceConfigImpl) DeleteConfig(key string) error

func (*GovernanceConfigImpl) DeleteConfigWithGroup

func (g *GovernanceConfigImpl) DeleteConfigWithGroup(group string, key string) error

func (*GovernanceConfigImpl) GetConfig

func (g *GovernanceConfigImpl) GetConfig(key string) (string, error)

func (*GovernanceConfigImpl) GetConfigWithGroup

func (g *GovernanceConfigImpl) GetConfigWithGroup(group string, key string) (string, error)

func (*GovernanceConfigImpl) GetList

func (g *GovernanceConfigImpl) GetList(group string) (map[string]string, error)

func (*GovernanceConfigImpl) Register

func (g *GovernanceConfigImpl) Register(url *common.URL) error

func (*GovernanceConfigImpl) SetConfig

func (g *GovernanceConfigImpl) SetConfig(key string, value string) error

func (*GovernanceConfigImpl) SetConfigWithGroup

func (g *GovernanceConfigImpl) SetConfigWithGroup(group string, key string, value string) error

func (*GovernanceConfigImpl) UnRegister

func (g *GovernanceConfigImpl) UnRegister(url *common.URL) error

type NacosGovImpl

type NacosGovImpl struct {
	GovernanceConfig
	// contains filtered or unexported fields
}

func (*NacosGovImpl) GetConfig

func (n *NacosGovImpl) GetConfig(key string) (string, error)

GetConfig transform Nacos specified 'node does not exist' err into unified admin rule error

func (*NacosGovImpl) GetList

func (n *NacosGovImpl) GetList(group string) (map[string]string, error)

func (*NacosGovImpl) SetConfig

func (n *NacosGovImpl) SetConfig(key string, value string) error

SetConfig transform Nacos specified 'node already exist' err into unified admin rule error

type Prometheus

type Prometheus struct {
	Ip   string `json:"ip"`
	Port string `json:"port"`
}

type RuleExists

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

func (*RuleExists) Error

func (exist *RuleExists) Error() string

type RuleNotFound

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

func (*RuleNotFound) Error

func (notFound *RuleNotFound) Error() string

type ZkGovImpl

type ZkGovImpl struct {
	GovernanceConfig
	// contains filtered or unexported fields
}

func (*ZkGovImpl) GetConfig

func (zk *ZkGovImpl) GetConfig(key string) (string, error)

GetConfig transform ZK specified 'node does not exist' err into unified admin rule error

func (*ZkGovImpl) GetList

func (zk *ZkGovImpl) GetList(group string) (map[string]string, error)

func (*ZkGovImpl) SetConfig

func (zk *ZkGovImpl) SetConfig(key string, value string) error

SetConfig transform ZK specified 'node already exist' err into unified admin rule error

Directories

Path Synopsis
Package mock_config is a generated GoMock package.
Package mock_config is a generated GoMock package.

Jump to

Keyboard shortcuts

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