Skip to content

Commit fd2b801

Browse files
author
Islam Alibekov
committed
Revert "sync upstream"
This reverts commit 8038568.
1 parent 8038568 commit fd2b801

769 files changed

Lines changed: 65 additions & 123965 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AUTHORS

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
1-
The following authors have created the source code of "Yandex.Cloud API" published and distributed by YANDEX LLC as the owner:
1+
The following authors have created the source code of "Yandex.Cloud Go SDK" published and distributed by YANDEX LLC as the owner:
22

3-
Alexander Burmak <alex-burmak@yandex-team.ru>
4-
Alexander Kirakozov <akirakozov@yandex-team.ru>
5-
Alexander Klyuev <wizard@yandex-team.ru>
6-
Alexander Serkov <alxn1@yandex-team.ru>
73
Alexey Baranov <baranovich@yandex-team.ru>
8-
Alexey Zamulla <zamulla@yandex-team.ru>
9-
Alexey Zasimov <zasimov-a@yandex-team.ru>
10-
Amy Krishnevsky <krishnevsky@yandex-team.ru>
11-
Anastasia Karavaeva <dottir@yandex-team.ru>
12-
Andrey Polyakov <koshachy@yandex-team.ru>
13-
Damir Makhmutov <yesworld@yandex-team.ru>
14-
Danila Diugurov <terry@yandex-team.ru>
15-
David Lanchava <landavid@yandex-team.ru>
16-
Elena Ilycheva <eilycheva@yandex-team.ru>
17-
Evgeny Arhipov <arhipov@yandex-team.ru>
4+
Andrey Kraynov <iceman@yandex-team.ru>
5+
Dmitry Novikov <novikoff@yandex-team.ru>
6+
Gennady Lipenkov <xgen@yandex-team.ru>
187
Luba Grinkevich <luba239@yandex-team.ru>
198
Maxim Kolganov <manykey@yandex-team.ru>
20-
Mikhail Goncharov <migelle@yandex-team.ru>
21-
Nikolay Amelichev <entropia@yandex-team.ru>
22-
Pavel Fomin <vaccarium@yandex-team.ru>
239
Rurik Krylov <rurikk@yandex-team.ru>
24-
Evgeny Dyukov <secwall@yandex-team.ru>
25-
Sergey Kanunnikov <skanunnikov@yandex-team.ru>
26-
Sergey Kiselev <intr13@yandex-team.ru>
27-
Sergey Sytnik <ssytnik@yandex-team.ru>
28-
Stanislav Ievlev <sievlev@yandex-team.ru>
2910
Vasilii Briginets <0x40@yandex-team.ru>
30-
Vlad Arkhipov <potamus@yandex-team.ru>
31-
Vladimir Borodin <d0uble@yandex-team.ru>
3211
Vladimir Skipor <skipor@yandex-team.ru>

README.md

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,68 @@
1-
# Yandex Cloud API
1+
# Yandex.Cloud Go SDK
22

3-
This repository contains the interface definitions of Yandex Cloud API.
3+
[![GoDoc](https://godoc.org/github.com/yandex-cloud/go-sdk?status.svg)](https://godoc.org/github.com/yandex-cloud/go-sdk)
4+
[![CircleCI](https://circleci.com/gh/yandex-cloud/go-sdk.svg?style=shield)](https://circleci.com/gh/yandex-cloud/go-sdk)
45

5-
For more details see [documentation](https://yandex.cloud/docs).
6+
Go SDK for Yandex.Cloud services.
67

7-
## Overview
8+
**NOTE:** SDK is under development, and may make
9+
backwards-incompatible changes.
810

9-
You can access Yandex Cloud by using REST or gRPC API.
11+
## Installation
1012

11-
Yandex Cloud API uses Protocol Buffers to define API interfaces and data structures. These definitions are used for both REST and GRPC versions of the Yandex Cloud API.
13+
```bash
14+
go get github.com/yandex-cloud/go-sdk
15+
```
1216

13-
## Repository structure
17+
## Example usages
1418

15-
Repository structure reflects Yandex Cloud service hierarchy. Folders represent different services of the platform and contain protobuf files. Each service folder contains resource data structure and interface definitions for API calls.
19+
### Initializing SDK
20+
21+
```go
22+
sdk, err := ycsdk.Build(ctx, ycsdk.Config{
23+
Credentials: ycsdk.OAuthToken(token),
24+
})
25+
if err != nil {
26+
log.Fatal(err)
27+
}
28+
```
29+
30+
### Retries
31+
32+
SDK provide built-in retry policy, that supports [exponential backoff and jitter](https://aws.amazon.com/ru/blogs/architecture/exponential-backoff-and-jitter/), and also [retry budget](https://github.com/grpc/proposal/blob/master/A6-client-retries.md#throttling-retry-attempts-and-hedged-rpcs).
33+
It's necessary to avoid retry amplification.
34+
35+
```go
36+
import (
37+
...
38+
ycsdk "github.com/yandex-cloud/go-sdk"
39+
"github.com/yandex-cloud/go-sdk/pkg/retry/v1"
40+
)
41+
42+
...
43+
44+
retriesDialOption, err := retry.DefaultRetryDialOption()
45+
if err != nil {
46+
log.Fatal(err)
47+
}
48+
49+
_, err = ycsdk.Build(
50+
ctx,
51+
ycsdk.Config{
52+
Credentials: ycsdk.OAuthToken(*token),
53+
},
54+
retriesDialOption,
55+
)
56+
```
57+
58+
SDK provide different modes for retry throttling policy:
59+
60+
* `persistent` is suitable when you use SDK in any long-lived application, when SDK instance will live long enough for manage budget;
61+
* `temporary` is suitable when you use SDK in any short-lived application, e.g. scripts or CI/CD.
62+
63+
By default, SDK will use temporary mode, but you can change it through functional option.
64+
65+
66+
### More examples
67+
68+
More examples can be found in [examples dir](examples).

third_party/googleapis/LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

third_party/googleapis/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

third_party/googleapis/google/api/annotations.proto

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)