credentials

package
v3.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCredentialsNoCredentials may be returned by Credentials implementations to
	// make driver act as if there no Credentials at all. That is, driver will
	// not send any token meta information during request.
	ErrCredentialsNoCredentials = errors.New("ydb: credentials: no credentials")
)

Functions

func NewAnonymousCredentials

func NewAnonymousCredentials(sourceInfo string) *anonymousCredentials

Types

type AccessTokenCredentials

type AccessTokenCredentials struct {
	AccessToken string
	// contains filtered or unexported fields
}

AccessTokenCredentials implements Credentials interface with static authorization parameters.

func NewAccessTokenCredentials

func NewAccessTokenCredentials(AccessToken string, sourceInfo string) *AccessTokenCredentials

func (AccessTokenCredentials) String

func (a AccessTokenCredentials) String() string

Token implements Credentials.

func (AccessTokenCredentials) Token

Token implements Credentials.

type Credentials

type Credentials interface {
	Token(context.Context) (string, error)
}

Credentials is an interface that contains options used to authorize a client.

func MultiCredentials

func MultiCredentials(cs ...Credentials) Credentials

MultiCredentials creates Credentials which represents multiple ways of obtaining token. Its Token() method proxies call to the underlying credentials in order. When first successful call met, it returns. If there are no successful calls, it returns last error.

type Func

type Func func(context.Context) (string, error)

Func is an adapter to allow the use of ordinary functions as Credentials.

func (Func) String

func (f Func) String() string

Token implements Credentials.

func (Func) Token

func (f Func) Token(ctx context.Context) (string, error)

Token implements Credentials.

Jump to

Keyboard shortcuts

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