environ

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 21

README

ydb-go-sdk-auth-environ

helpers to connect to YDB using environ

Installation

go get -u github.com/ydb-platform/ydb-go-sdk-auth-environ

Usage

import (
	env "github.com/ydb-platform/ydb-go-sdk-auth-environ"
)
...
    db, err := ydb.New(
        ctx,
        connectParams,
        env.WithEnvironCredentials(ctx), 
    )
    

Auth environment variables

Name Type Default yandex-cloud Description
YDB_ANONYMOUS_CREDENTIALS 0 or 1 0 - flag for use anonymous credentials
YDB_METADATA_CREDENTIALS 0 or 1 + flag for use metadata credentials
YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS string + path to service account key file credentials
YDB_ACCESS_TOKEN_CREDENTIALS string +/- use access token for authenticate with YDB. For authenticate with YDB inside yandex-cloud use short-life IAM-token. Other YDB installations can use access token depending on authenticate method

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEnvironCredentials

func WithEnvironCredentials(ctx context.Context) ydb.Option

Types

This section is empty.

Jump to

Keyboard shortcuts

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