rpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadClientFromConfig

func LoadClientFromConfig(conf *Config) error

Types

type ClientSet

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

Client 客户端

func C

func C() *ClientSet

C Global

func NewClient

func NewClient(conf *Config) (*ClientSet, error)

NewClient todo

func (*ClientSet) Instance

func (c *ClientSet) Instance() instance.ServiceClient

instance服务的SDK

func (*ClientSet) Registry

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 NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig todo

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

func (r *Resolver) ToQueryString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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