Documentation ¶
Index ¶
- Constants
- func WithAuthAsServiceAccount(serviceAccountID string) grpc.CallOption
- func WithAuthAsServiceAccounts(saGetter SAGetter) grpc.CallOption
- type APIEndpoint
- type Authenticator
- type Config
- type Credentials
- type Endpoint
- type ExchangeableCredentials
- type IAMTokenCredentials
- type IamTokenMiddleware
- func (c *IamTokenMiddleware) GetIAMToken(ctx context.Context, originalSubject bool, opts ...grpc.CallOption) (string, error)
- func (c *IamTokenMiddleware) InterceptStream(ctx context.Context, desc *grpc.StreamDesc, conn *grpc.ClientConn, ...) (grpc.ClientStream, error)
- func (c *IamTokenMiddleware) InterceptUnary(ctx context.Context, method string, req, reply interface{}, ...) error
- type NoCredentials
- type NonExchangeableCredentials
- type SAGetter
- type SDK
- func (sdk *SDK) CheckEndpointConnection(ctx context.Context, endpoint Endpoint) error
- func (sdk *SDK) ClickHouse() *clickhouse.ClickHouse
- func (sdk *SDK) CreateIAMToken(ctx context.Context) (*iamkey.CreateIamTokenResponse, error)
- func (sdk *SDK) CreateIAMTokenForServiceAccount(ctx context.Context, serviceAccountID string) (*iamkey.CreateIamTokenResponse, error)
- func (sdk *SDK) Endpoint(endpointName Endpoint) (ep *APIEndpoint, exist bool)
- func (sdk *SDK) InitErr() error
- func (sdk *SDK) Kafka() *kafka.Kafka
- func (sdk *SDK) KnownServices() []string
- func (sdk *SDK) Logs() *logs.Export
- func (sdk *SDK) Network() *network.Network
- func (sdk *SDK) Shutdown(ctx context.Context) error
- func (sdk *SDK) Transfer() *transfer.Transfer
- func (sdk *SDK) Visualization() *visualization.Visualization
- func (sdk *SDK) WrapOperation(o *dcv1.Operation, err error) (*operation.Operation, error)
- type ServiceIsNotAvailableError
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func WithAuthAsServiceAccount ¶
func WithAuthAsServiceAccount(serviceAccountID string) grpc.CallOption
func WithAuthAsServiceAccounts ¶
func WithAuthAsServiceAccounts(saGetter SAGetter) grpc.CallOption
Types ¶
type APIEndpoint ¶
type Authenticator ¶
type Config ¶
type Config struct { // Credentials are used to authenticate the client. See Credentials for more info. Credentials Credentials // DialContextTimeout specifies timeout of dial on API endpoint that // is used when building an SDK instance. // DialContextTimeout time.Duration // TLSConfig is optional tls.Config that one can use in order to tune TLS options. TLSConfig *tls.Config // Endpoint is an API endpoint of DoubleCloud against which the SDK is used. // Most users won't need to explicitly set it. Endpoint string OverrideEndpoint bool Plaintext bool }
Config is a config that is used to create SDK instance.
type Credentials ¶
type Credentials interface {
DCAPICredentials()
}
Credentials is an abstraction of API authorization credentials. See https://double.cloud/docs/en/public-api/get-iam-token for details. Note that functions that return Credentials may return different Credentials implementation in next SDK version, and this is not considered breaking change.
func ServiceAccountKey ¶
func ServiceAccountKey(key *iamkey.Key) (Credentials, error)
ServiceAccountKey returns credentials for the given IAM Key. The key is used to sign JWT tokens. JWT tokens are exchanged for IAM Tokens used to authorize API calls. This authorization method is not supported for IAM Keys issued for User Accounts.
type ExchangeableCredentials ¶
type ExchangeableCredentials interface { Credentials // IAMTokenRequest returns request for fresh IAM token or error. IAMTokenRequest() (*iamkey.CreateIamTokenRequest, error) }
ExchangeableCredentials can be exchanged for IAM Token in IAM Token Service, that can be used to authorize API calls. See https://double.cloud/docs/en/public-api/get-iam-token for details.
type IAMTokenCredentials ¶
type IAMTokenCredentials struct {
// contains filtered or unexported fields
}
IAMTokenCredentials implements Credentials with IAM token as-is
func (IAMTokenCredentials) DCAPICredentials ¶
func (creds IAMTokenCredentials) DCAPICredentials()
func (IAMTokenCredentials) IAMToken ¶
func (creds IAMTokenCredentials) IAMToken(ctx context.Context) (*iamkey.CreateIamTokenResponse, error)
type IamTokenMiddleware ¶
type IamTokenMiddleware struct {
// contains filtered or unexported fields
}
func NewIAMTokenMiddleware ¶
func NewIAMTokenMiddleware(authenticator Authenticator, now func() time.Time) *IamTokenMiddleware
func (*IamTokenMiddleware) GetIAMToken ¶
func (c *IamTokenMiddleware) GetIAMToken(ctx context.Context, originalSubject bool, opts ...grpc.CallOption) (string, error)
func (*IamTokenMiddleware) InterceptStream ¶
func (c *IamTokenMiddleware) InterceptStream(ctx context.Context, desc *grpc.StreamDesc, conn *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
func (*IamTokenMiddleware) InterceptUnary ¶
func (c *IamTokenMiddleware) InterceptUnary(ctx context.Context, method string, req, reply interface{}, conn *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
type NoCredentials ¶
type NoCredentials struct{}
NoCredentials implements Credentials, it allows to create unauthenticated connections
func (NoCredentials) DCAPICredentials ¶
func (creds NoCredentials) DCAPICredentials()
func (NoCredentials) IAMToken ¶
func (creds NoCredentials) IAMToken(ctx context.Context) (*iamkey.CreateIamTokenResponse, error)
IAMToken always returns gRPC error with status UNAUTHENTICATED
type NonExchangeableCredentials ¶
type NonExchangeableCredentials interface { Credentials // IAMToken returns IAM Token. IAMToken(ctx context.Context) (*iamkey.CreateIamTokenResponse, error) }
NonExchangeableCredentials allows to get IAM Token without calling IAM Token Service.
func NewIAMTokenCredentials ¶
func NewIAMTokenCredentials(iamToken string) NonExchangeableCredentials
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
SDK is a DoubleCloud SDK
func (*SDK) CheckEndpointConnection ¶
func (*SDK) ClickHouse ¶
func (sdk *SDK) ClickHouse() *clickhouse.ClickHouse
func (*SDK) CreateIAMToken ¶
func (*SDK) CreateIAMTokenForServiceAccount ¶
func (*SDK) Endpoint ¶
func (sdk *SDK) Endpoint(endpointName Endpoint) (ep *APIEndpoint, exist bool)
func (*SDK) KnownServices ¶
func (*SDK) Visualization ¶
func (sdk *SDK) Visualization() *visualization.Visualization
type ServiceIsNotAvailableError ¶
type ServiceIsNotAvailableError struct { ServiceID Endpoint APIEndpoint string // contains filtered or unexported fields }
func (*ServiceIsNotAvailableError) Error ¶
func (s *ServiceIsNotAvailableError) Error() string
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
gen
|
|
clickhouse
nolint
|
nolint |
kafka
nolint
|
nolint |
logs
nolint
|
nolint |
network
nolint
|
nolint |
transfer
nolint
|
nolint |
visualization
nolint
|
nolint |
pkg
|
|