Documentation ¶
Index ¶
- func GetClientCredential(ctx context.Context) (clientId, clientSecret string)
- func LoadClientFromEnv() error
- func SetGlobal(cli *ClientSet)
- type Authentication
- type ClientSet
- func (c *ClientSet) ClientInfo(ctx context.Context) (*service.Service, error)
- func (c *ClientSet) Code() code.RPCClient
- func (c *ClientSet) Config() Config
- func (c *ClientSet) Endpoint() endpoint.RPCClient
- func (c *ClientSet) Permission() permission.RPCClient
- func (c *ClientSet) Service() service.RPCClient
- func (c *ClientSet) Token() token.RPCClient
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientCredential ¶
Types ¶
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
Authentication todo
func NewAuthentication ¶
func NewAuthentication(clientId, clientSecret string) *Authentication
客户端携带的凭证
func (*Authentication) GetRequestMetadata ¶
func (a *Authentication) GetRequestMetadata(context.Context, ...string) ( map[string]string, error, )
GetRequestMetadata todo
func (*Authentication) RequireTransportSecurity ¶
func (a *Authentication) RequireTransportSecurity() bool
RequireTransportSecurity todo
func (*Authentication) SetClientCredentials ¶
func (a *Authentication) SetClientCredentials(clientID, clientSecret string)
SetClientCredentials todo
type ClientSet ¶
type ClientSet struct {
// contains filtered or unexported fields
}
Client 客户端
func (*ClientSet) ClientInfo ¶
返回客户端服务信息
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"` }
Config 客户端配置
func (*Config) Credentials ¶
func (c *Config) Credentials() *Authentication
Click to show internal directories.
Click to hide internal directories.