Home

Awesome

ydb-go-yc

License PkgGoDev tests lint Go Report Card codecov Code lines WebSite

Helpers to connect to YDB inside yandex-cloud.

Table of contents

  1. Overview
  2. About semantic versioning
  3. Prerequisites
  4. Installation
  5. Usage

Overview <a name="Overview"></a>

Currently package provides helpers to connect to YDB inside yandex-cloud.

About semantic versioning <a name="SemVer"></a>

We follow the SemVer 2.0.0. In particular, we provide backward compatibility in the MAJOR releases. New features without loss of backward compatibility appear on the MINOR release. In the minor version, the patch number starts from 0. Bug fixes and internal changes are released with the third digit (PATCH) in the version.

There are, however, some changes with the loss of backward compatibility that we consider to be MINOR:

Internal interfaces outside from internal directory are marked with comment such as

// Warning: only for internal usage inside ydb-go-yc

We publish the planned breaking MAJOR changes:

Prerequisites <a name="Prerequisites"></a>

Requires Go 1.13 or later.

Installation <a name="Installation"></a>

go get -u github.com/ydb-platform/ydb-go-yc

Usage <a name="Usage"></a>

import (
    yc "github.com/ydb-platform/ydb-go-yc"
)
...
    db, err := ydb.Open(ctx, os.Getenv("YDB_CONNECTION_STRING"),
        yc.WithInternalCA(),
        yc.WithServiceAccountKeyFileCredentials("~/.ydb/sa.json"), // auth from service account key file
        // yc.WithMetadataCredentials(), // auth inside cloud (virual machine or yandex function)
    )