Documentation ¶
Index ¶
- func NewTrustedProfileCredentials(authEndpoint, trustedProfileName, trustedProfileID, crTokenFilePath string) *credentials.Credentials
- type COSConfig
- type COSObjectClient
- func (c *COSObjectClient) DeleteObject(ctx context.Context, objectKey string) error
- func (c *COSObjectClient) GetAttributes(ctx context.Context, objectKey string) (client.ObjectAttributes, error)
- func (c *COSObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)
- func (c *COSObjectClient) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)
- func (c *COSObjectClient) IsObjectNotFoundErr(err error) bool
- func (c *COSObjectClient) IsRetryableErr(error) bool
- func (c *COSObjectClient) List(ctx context.Context, prefix, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
- func (c *COSObjectClient) ObjectExists(ctx context.Context, objectKey string) (bool, error)
- func (c *COSObjectClient) PutObject(ctx context.Context, objectKey string, object io.Reader) error
- func (c *COSObjectClient) Stop()
- type HTTPConfig
- type InjectRequestMiddleware
- type TrustedProfileProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTrustedProfileCredentials ¶
func NewTrustedProfileCredentials(authEndpoint, trustedProfileName, trustedProfileID, crTokenFilePath string) *credentials.Credentials
NewTrustedProfileCredentials a constructor for IBM IAM that uses IAM Trusted Profile credentials passed in
Types ¶
type COSConfig ¶
type COSConfig struct { ForcePathStyle bool `yaml:"forcepathstyle"` BucketNames string `yaml:"bucketnames"` Endpoint string `yaml:"endpoint"` Region string `yaml:"region"` AccessKeyID string `yaml:"access_key_id"` SecretAccessKey flagext.Secret `yaml:"secret_access_key"` HTTPConfig HTTPConfig `yaml:"http_config"` BackoffConfig backoff.Config `yaml:"backoff_config" doc:"description=Configures back off when cos get Object."` APIKey flagext.Secret `yaml:"api_key"` ServiceInstanceID string `yaml:"service_instance_id"` AuthEndpoint string `yaml:"auth_endpoint"` CRTokenFilePath string `yaml:"cr_token_file_path"` TrustedProfileName string `yaml:"trusted_profile_name"` TrustedProfileID string `yaml:"trusted_profile_id"` }
COSConfig specifies config for storing chunks on IBM cos.
func (*COSConfig) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet
type COSObjectClient ¶
type COSObjectClient struct {
// contains filtered or unexported fields
}
func NewCOSObjectClient ¶
func NewCOSObjectClient(cfg COSConfig, hedgingCfg hedging.Config) (*COSObjectClient, error)
NewCOSObjectClient makes a new COS backed ObjectClient.
func (*COSObjectClient) DeleteObject ¶
func (c *COSObjectClient) DeleteObject(ctx context.Context, objectKey string) error
DeleteObject deletes the specified objectKey from the appropriate S3 bucket
func (*COSObjectClient) GetAttributes ¶ added in v3.3.0
func (c *COSObjectClient) GetAttributes(ctx context.Context, objectKey string) (client.ObjectAttributes, error)
func (*COSObjectClient) GetObject ¶
func (c *COSObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)
GetObject returns a reader and the size for the specified object key from the configured S3 bucket.
func (*COSObjectClient) GetObjectRange ¶ added in v3.2.0
func (c *COSObjectClient) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)
GetObject returns a reader and the size for the specified object key from the configured S3 bucket.
func (*COSObjectClient) IsObjectNotFoundErr ¶
func (c *COSObjectClient) IsObjectNotFoundErr(err error) bool
IsObjectNotFoundErr returns true if error means that object is not found. Relevant to GetObject and DeleteObject operations.
func (*COSObjectClient) IsRetryableErr ¶
func (c *COSObjectClient) IsRetryableErr(error) bool
TODO(dannyk): implement for client
func (*COSObjectClient) List ¶
func (c *COSObjectClient) List(ctx context.Context, prefix, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
List implements chunk.ObjectClient.
func (*COSObjectClient) ObjectExists ¶
func (*COSObjectClient) Stop ¶
func (c *COSObjectClient) Stop()
Stop fulfills the chunk.ObjectClient interface
type HTTPConfig ¶
type HTTPConfig struct { IdleConnTimeout time.Duration `yaml:"idle_conn_timeout"` ResponseHeaderTimeout time.Duration `yaml:"response_header_timeout"` }
HTTPConfig stores the http.Transport configuration
type InjectRequestMiddleware ¶
type InjectRequestMiddleware func(next http.RoundTripper) http.RoundTripper
InjectRequestMiddleware gives users of this client the ability to make arbitrary changes to outgoing requests.
type TrustedProfileProvider ¶
type TrustedProfileProvider struct { // Error ErrorStatus error // contains filtered or unexported fields }
TrustedProfileProvider implements Provider interface from https://github.com/IBM/ibm-cos-sdk-go
func NewTrustedProfileProvider ¶
func NewTrustedProfileProvider(providerName string, trustedProfileName, trustedProfileID, crTokenFilePath, authEndpoint string) *TrustedProfileProvider
NewTrustedProfileProvider creates custom IBM IAM Provider for Trusted Profile authentication
func (*TrustedProfileProvider) IsExpired ¶
func (p *TrustedProfileProvider) IsExpired() bool
IsExpired should ideally check the token expiry but here we are skipping the expiry check since the token variable in authenticator is not an exported variable. The GetToken function in Retrieve method is checking whether the token is expired or not before making the call to the server.
func (*TrustedProfileProvider) IsValid ¶
func (p *TrustedProfileProvider) IsValid() bool
IsValid validates the trusted profile provider
func (*TrustedProfileProvider) Retrieve ¶
func (p *TrustedProfileProvider) Retrieve() (credentials.Value, error)
Retrieve returns the creadential values