https://github.com/ydb-platform/ydb-go-yc
https://github.com/ydb-platform/ydb-go-yc
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ydb-platform/ydb-go-yc
- Owner: ydb-platform
- License: apache-2.0
- Created: 2021-08-30T09:31:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-21T10:22:40.000Z (almost 2 years ago)
- Last Synced: 2024-08-21T11:51:49.693Z (almost 2 years ago)
- Language: Go
- Size: 256 KB
- Stars: 5
- Watchers: 5
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Authors: AUTHORS
Awesome Lists containing this project
README
# ydb-go-yc
[](https://github.com/ydb-platform/ydb/blob/main/LICENSE)
[](https://pkg.go.dev/github.com/ydb-platform/ydb-go-yc)


[](https://goreportcard.com/report/github.com/ydb-platform/ydb-go-yc)
[](https://app.codecov.io/gh/ydb-platform/ydb-go-yc)

[](https://ydb.tech)
Helpers to connect to YDB inside yandex-cloud.
## Table of contents
1. [Overview](#Overview)
2. [About semantic versioning](#SemVer)
3. [Prerequisites](#Prerequisites)
4. [Installation](#Install)
5. [Usage](#Usage)
Currently package provides helpers to connect to YDB inside yandex-cloud.
We follow the **[SemVer 2.0.0](https://semver.org)**. 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`:
* extension or modification of internal `ydb-go-yc` interfaces. We understand that this will break the compatibility of custom implementations of the `ydb-go-yc` internal interfaces. But we believe that the internal interfaces of `ydb-go-yc` are implemented well enough that they do not require custom implementation. We are working to ensure that all internal interfaces have limited access only inside `ydb-go-yc`.
* major changes to (including removal of) the public interfaces and types that have been previously exported by `ydb-go-yc`. We understand that these changes will break the backward compatibility of early adopters of these interfaces. However, these changes are generally coordinated with early adopters and have the concise interfacing with `ydb-go-yc` as a goal.
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:
* via the comment `Deprecated` in the code indicating what should be used instead
* through the file [`NEXT_MAJOR_RELEASE.md`](#NEXT_MAJOR_RELEASE.md)
Requires Go 1.13 or later.
```bash
go get -u github.com/ydb-platform/ydb-go-yc
```
```go
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)
)
```