Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenCredentials ¶
type TokenCredentials struct {
// contains filtered or unexported fields
}
TokenCredentials RPC Credentials
func WithStaticToken ¶
func WithStaticToken(token string) *TokenCredentials
WithStaticToken injects a static token on each request
func WithTokenFunc ¶
func WithTokenFunc(k string, tokenFunc func(v string) string) *TokenCredentials
WithTokenFunc returns TokenCredentials that execute the tokenFunc on each request The value of v sent to the tokenFunk is the MD value of the supplied k
func (*TokenCredentials) DialOption ¶
func (c *TokenCredentials) DialOption() grpc.DialOption
DialOption returns a DialOption for the TokenCredentials
func (*TokenCredentials) GetRequestMetadata ¶
func (c *TokenCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
GetRequestMetadata implements credentials.PerRPCCredentials
func (*TokenCredentials) RequireTransportSecurity ¶
func (c *TokenCredentials) RequireTransportSecurity() bool
RequireTransportSecurity implements credentials.PerRPCCredentials
func (*TokenCredentials) WithInsecure ¶
func (c *TokenCredentials) WithInsecure() *TokenCredentials
WithInsecure returns a copy of the TokenCredentials, allowing insecure transport
Click to show internal directories.
Click to hide internal directories.