Documentation ¶
Index ¶
- Constants
- func IsDatahubError(err *datahubmodels.Error, code string, message string) bool
- func IsDatalakeError(err *datalakemodels.Error, code string, message string) bool
- func IsEnvironmentsError(err *environmentsmodels.Error, code string, message string) bool
- func IsIamError(err *iammodels.Error, code string, message string) bool
- func IsMlError(err *mlmodels.Error, code string, message string) bool
- func NewDatahubClient(config *Config) (*datahubclient.Datahub, error)
- func NewDatalakeClient(config *Config) (*datalakeclient.Datalake, error)
- func NewDwClient(config *Config) (*dwclient.Dw, error)
- func NewEnvironmentsClient(config *Config) (*environmentsclient.Environments, error)
- func NewIamClient(config *Config) (*iamclient.Iam, error)
- func NewMlClient(config *Config) (*mlclient.Ml, error)
- type ChainCredentialsProvider
- type Client
- type ClientTransport
- type Config
- func (config *Config) GetAltusApiEndpoint() (string, error)
- func (config *Config) GetBaseApiPath() string
- func (config *Config) GetCdpApiEndpoint() (string, error)
- func (config *Config) GetCdpConfigFile() (string, error)
- func (config *Config) GetCdpCredentialsFile() (string, error)
- func (config *Config) GetCdpProfile() (string, error)
- func (config *Config) GetCdpRegion() (string, error)
- func (config *Config) GetCredentials() (*Credentials, error)
- func (config *Config) GetEndpoint(serviceName string, isAltusService bool) (string, error)
- func (config *Config) GetLocalEnvironment() bool
- func (config *Config) GetUserAgentOrDefault() string
- func (config *Config) String() string
- func (config *Config) WithAltusApiEndpointUrl(altusApiEndpointUrl string) *Config
- func (config *Config) WithBaseApiPath(baseApiPath string) *Config
- func (config *Config) WithCdpApiEndpointUrl(cdpApiEndpointUrl string) *Config
- func (config *Config) WithCdpRegion(cdpRegion string) *Config
- func (config *Config) WithClientApplicationName(clientApplicationName string) *Config
- func (config *Config) WithConfigFile(configFile string) *Config
- func (config *Config) WithContext(ctx context.Context) *Config
- func (config *Config) WithCredentials(credentials *Credentials) *Config
- func (config *Config) WithCredentialsFile(credentialsFile string) *Config
- func (config *Config) WithLocalEnvironment(localEnvironment bool) *Config
- func (config *Config) WithLogger(logger Logger) *Config
- func (config *Config) WithProfile(profile string) *Config
- func (config *Config) WithUserAgent(userAgent string) *Config
- func (config *Config) WithVersion(version string) *Config
- type Credentials
- type CredentialsProvider
- type DefaultLogger
- func (l *DefaultLogger) Debugf(_ context.Context, format string, args ...any)
- func (l *DefaultLogger) Errorf(_ context.Context, format string, args ...any)
- func (l *DefaultLogger) Infof(_ context.Context, format string, args ...any)
- func (l *DefaultLogger) Warnf(_ context.Context, format string, args ...any)
- type DelegatingRoundTripper
- type EnvCredentialsProvider
- type FileCredentialsProvider
- type Logger
- type LoggingRoundTripper
- type RequestHeadersRoundTripper
- type StaticCredentialsProvider
Constants ¶
const ( RegionUsWest1 = "us-west-1" RegionEu1 = "eu-1" RegionAp1 = "ap-1" RegionUsg1 = "usg-1" )
exported constants
const ( // CdpAccessKeyIdEnvVar Name of environment variable holding the users CDP access key ID. CdpAccessKeyIdEnvVar = "CDP_ACCESS_KEY_ID" // CdpPrivateKeyEnvVar Name of environment variable holding the users CDP private key. CdpPrivateKeyEnvVar = "CDP_PRIVATE_KEY" )
const ( // CdpProfileEnvVar is the environment variable to configure the CDP profile // Python client uses both CDP_PROFILE and CDP_DEFAULT_PROFILE // versus Java SDK uses CDP_DEFAULT_PROFILE CdpProfileEnvVar = "CDP_PROFILE" )
Variables ¶
This section is empty.
Functions ¶
func IsDatahubError ¶
func IsDatahubError(err *datahubmodels.Error, code string, message string) bool
func IsDatalakeError ¶
func IsDatalakeError(err *datalakemodels.Error, code string, message string) bool
func IsEnvironmentsError ¶
func IsEnvironmentsError(err *environmentsmodels.Error, code string, message string) bool
func NewDatahubClient ¶
func NewDatahubClient(config *Config) (*datahubclient.Datahub, error)
func NewDatalakeClient ¶
func NewDatalakeClient(config *Config) (*datalakeclient.Datalake, error)
func NewEnvironmentsClient ¶
func NewEnvironmentsClient(config *Config) (*environmentsclient.Environments, error)
Types ¶
type ChainCredentialsProvider ¶
type ChainCredentialsProvider struct {
ProviderChain []CredentialsProvider
}
ChainCredentialsProvider returns CDP credentials by using a chain of credential providers in order.
func (*ChainCredentialsProvider) GetCredentials ¶
func (p *ChainCredentialsProvider) GetCredentials() (*Credentials, error)
type Client ¶
type Client struct { Environments *environmentsclient.Environments Datalake *datalakeclient.Datalake Datahub *datahubclient.Datahub Iam *iamclient.Iam Ml *mlclient.Ml Dw *dwclient.Dw // contains filtered or unexported fields }
type ClientTransport ¶
func (*ClientTransport) Submit ¶
func (t *ClientTransport) Submit(operation *runtime.ClientOperation) (interface{}, error)
type Config ¶
type Config struct { CdpApiEndpointUrl string AltusApiEndpointUrl string Profile string CdpRegion string Credentials *Credentials BaseApiPath string ConfigFile string CredentialsFile string LocalEnvironment bool Logger Logger Context context.Context UserAgent string ClientApplicationName string Version string // contains filtered or unexported fields }
func (*Config) GetAltusApiEndpoint ¶
func (*Config) GetBaseApiPath ¶
func (*Config) GetCdpApiEndpoint ¶
func (*Config) GetCdpConfigFile ¶
func (*Config) GetCdpCredentialsFile ¶
func (*Config) GetCdpProfile ¶
func (*Config) GetCdpRegion ¶
func (*Config) GetCredentials ¶
func (config *Config) GetCredentials() (*Credentials, error)
func (*Config) GetEndpoint ¶
func (*Config) GetLocalEnvironment ¶
func (*Config) GetUserAgentOrDefault ¶
func (*Config) WithAltusApiEndpointUrl ¶
func (*Config) WithBaseApiPath ¶
func (*Config) WithCdpApiEndpointUrl ¶
func (*Config) WithCdpRegion ¶
func (*Config) WithClientApplicationName ¶
func (*Config) WithConfigFile ¶
func (*Config) WithCredentials ¶
func (config *Config) WithCredentials(credentials *Credentials) *Config
func (*Config) WithCredentialsFile ¶
func (*Config) WithLocalEnvironment ¶
func (*Config) WithLogger ¶
func (*Config) WithProfile ¶
func (*Config) WithUserAgent ¶
func (*Config) WithVersion ¶
type Credentials ¶
func (*Credentials) String ¶
func (credentials *Credentials) String() string
type CredentialsProvider ¶
type CredentialsProvider interface {
GetCredentials() (*Credentials, error)
}
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func NewDefaultLogger ¶
func NewDefaultLogger() *DefaultLogger
func (*DefaultLogger) Debugf ¶
func (l *DefaultLogger) Debugf(_ context.Context, format string, args ...any)
func (*DefaultLogger) Errorf ¶
func (l *DefaultLogger) Errorf(_ context.Context, format string, args ...any)
type DelegatingRoundTripper ¶
type DelegatingRoundTripper struct {
// contains filtered or unexported fields
}
type EnvCredentialsProvider ¶
type EnvCredentialsProvider struct { }
EnvCredentialsProvider provides credentials from environment variables CDP_ACCESS_KEY_ID and CDP_PRIVATE_KEY
func (*EnvCredentialsProvider) GetCredentials ¶
func (*EnvCredentialsProvider) GetCredentials() (*Credentials, error)
type FileCredentialsProvider ¶
type FileCredentialsProvider struct {
// contains filtered or unexported fields
}
FileCredentialsProvider provides credentials by reading the profile and credentials from shared configuration and credentials files. By default, it uses ~/.cdp/config and ~/.cdp/credentials. These files are shared between CDP CLI and all CDP SDKs.
func NewFileCredentialsProvider ¶
func NewFileCredentialsProvider(path string, profile string) *FileCredentialsProvider
func (*FileCredentialsProvider) GetCredentials ¶
func (p *FileCredentialsProvider) GetCredentials() (*Credentials, error)
type Logger ¶
type Logger interface { Errorf(ctx context.Context, format string, args ...any) Warnf(ctx context.Context, format string, args ...any) Infof(ctx context.Context, format string, args ...any) Debugf(ctx context.Context, format string, args ...any) }
Logger is a simple interface so that SDK users can write their own logging adaptors
type LoggingRoundTripper ¶
type LoggingRoundTripper struct { DelegatingRoundTripper // contains filtered or unexported fields }
type RequestHeadersRoundTripper ¶
type RequestHeadersRoundTripper struct { DelegatingRoundTripper // contains filtered or unexported fields }
RequestHeadersRoundTripper sets the User-Agent and other custom headers see https://github.com/go-swagger/go-swagger/blob/701e7f3ee85df9d47fcf639dd7a279f7ab6d94d7/docs/faq/faq_client.md?plain=1#L28
func (*RequestHeadersRoundTripper) AddHeader ¶
func (r *RequestHeadersRoundTripper) AddHeader(key, value string)
type StaticCredentialsProvider ¶
type StaticCredentialsProvider struct {
Credentials *Credentials
}
StaticCredentialsProvider provides credentials from pre-configured static Credentials
func (*StaticCredentialsProvider) GetCredentials ¶
func (p *StaticCredentialsProvider) GetCredentials() (*Credentials, error)