Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadClientFromConfig ¶
Types ¶
type ClientSet ¶
type ClientSet struct {
// contains filtered or unexported fields
}
Client 客户端
func (*ClientSet) Registry ¶
func (c *ClientSet) Registry(ctx context.Context, req *instance.RegistryRequest) (lifecycle.Lifecycler, error)
func (*ClientSet) Service ¶
func (c *ClientSet) Service() service.MetaServiceClient
type Config ¶
type Config struct { Address string `json:"adress" toml:"adress" yaml:"adress" env:"MCENTER_ADDRESS"` ClientID string `json:"client_id" toml:"client_id" yaml:"client_id" env:"MCENTER_CLINET_ID"` ClientSecret string `json:"client_secret" toml:"client_secret" yaml:"client_secret" env:"MCENTER_CLIENT_SECRET"` Resolver *Resolver `json:"resolver" toml:"resolver" yaml:"resolver"` }
Config 客户端配置
func (*Config) Credentials ¶
func (c *Config) Credentials() *auth.Authentication
type Resolver ¶
type Resolver struct { // 实例所属地域, 默认default Region string `json:"region" toml:"region" yaml:"region" env:"MCENTER_REGION" validate:"required"` // 实例所属环境, 默认default Environment string `json:"environment" toml:"environment" yaml:"environment" env:"MCENTER_ENV" validate:"required"` // 实例所属分组,默认default Group string `json:"group" toml:"group" yaml:"group" env:"MCENTER_GROUP" validate:"required"` // 实例标签, 可以根据标签快速过滤实例, 格式k=v,k=v Tags string `json:"tags" toml:"tags" yaml:"tags" env:"MCENTER_TAGS"` }
func NewDefaultResolver ¶
func NewDefaultResolver() *Resolver
func (*Resolver) ToQueryString ¶
Click to show internal directories.
Click to hide internal directories.