yc

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIAMKeyUnspecified   = errors.New("either IAMKey or IAMKeyFile must be provided")
	ErrIAMKey              = errors.New("error reading IAM key")
	ErrIAMKeyFile          = errors.New("error reading IAM key file")
	ErrIAMTokenCreate      = errors.New("error creating IAM token")
	ErrServiceAccountCreds = errors.New("error reading service account credentials")
	ErrYCSDK               = errors.New("error reading YC SDK client")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// IamKeyFile specifies file path to IAM key file in jsom format.
	IamKeyFile string

	// IamKey specifies service account IAM key (usually in json format).
	// This param (if not empty) takes precedence over IamKeyFile.
	IamKey []byte
}

Config is Yandex CLoud authenticator config.

type YC

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

YC is Yandex Cloud authenticator.

func New

func New(ctx context.Context, cfg Config) (*YC, error)

func (*YC) GetToken

func (a *YC) GetToken(ctx context.Context) (token string, expires time.Time, err error)

Jump to

Keyboard shortcuts

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