s3

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanRunS3Test added in v1.0.1

func CanRunS3Test() bool

func DefaultAWSConfig

func DefaultAWSConfig() (aws.Config, error)

func HasValidCredentials

func HasValidCredentials(config aws.Config) bool

HasValidCredentials returns true if the AWS config has valid credentials.

func IsAWSEndpoint added in v1.2.0

func IsAWSEndpoint(endpoint string) bool

IsAWSEndpoint checks if the given S3 endpoint URL is an AWS endpoint by its suffix. If the endpoint is empty, it is considered an AWS endpoint.

Types

type ClientProvider

type ClientProvider struct {
	// contains filtered or unexported fields
}

func NewClientProvider

func NewClientProvider(params ClientProviderParams) *ClientProvider

func (*ClientProvider) GetClient

func (s *ClientProvider) GetClient(endpoint, region string) *ClientWrapper

func (*ClientProvider) GetConfig

func (s *ClientProvider) GetConfig() aws.Config

GetConfig returns the AWS config used by the client provider.

func (*ClientProvider) IsInstalled

func (s *ClientProvider) IsInstalled() bool

IsInstalled returns true if the S3 client is installed.

type ClientProviderParams

type ClientProviderParams struct {
	AWSConfig aws.Config
}

type ClientWrapper

type ClientWrapper struct {
	S3 *s3.Client

	Downloader *manager.Downloader
	Uploader   *manager.Uploader
	Endpoint   string
	Region     string
	// contains filtered or unexported fields
}

func (*ClientWrapper) IsAWSEndpoint added in v1.2.0

func (c *ClientWrapper) IsAWSEndpoint() bool

IsAWSEndpoint checks if the given S3 endpoint URL is an AWS endpoint by its suffix.

func (*ClientWrapper) PresignClient added in v1.1.4

func (c *ClientWrapper) PresignClient() *s3.PresignClient

type PreSignedResultSpec added in v1.1.4

type PreSignedResultSpec struct {
	SourceSpec
	PreSignedURL string
}

func DecodePreSignedResultSpec added in v1.1.4

func DecodePreSignedResultSpec(spec *models.SpecConfig) (PreSignedResultSpec, error)

func (PreSignedResultSpec) ToMap added in v1.1.4

func (c PreSignedResultSpec) ToMap() map[string]interface{}

func (PreSignedResultSpec) Validate added in v1.1.4

func (c PreSignedResultSpec) Validate() error

type PublisherSpec added in v1.0.4

type PublisherSpec struct {
	Bucket   string `json:"Bucket"`
	Key      string `json:"Key"`
	Endpoint string `json:"Endpoint"`
	Region   string `json:"Region"`
}

func DecodePublisherSpec added in v1.0.4

func DecodePublisherSpec(spec *models.SpecConfig) (PublisherSpec, error)

func (PublisherSpec) ToMap added in v1.0.4

func (c PublisherSpec) ToMap() map[string]interface{}

func (PublisherSpec) Validate added in v1.0.4

func (c PublisherSpec) Validate() error

type ResultSigner added in v1.1.4

type ResultSigner struct {
	// contains filtered or unexported fields
}

func NewResultSigner added in v1.1.4

func NewResultSigner(params ResultSignerParams) *ResultSigner

func (*ResultSigner) Transform added in v1.1.4

func (signer *ResultSigner) Transform(ctx context.Context, spec *models.SpecConfig) error

Transform signs S3 SourceSpec with a pre-signed URL.

type ResultSignerParams added in v1.1.4

type ResultSignerParams struct {
	ClientProvider *ClientProvider
	Expiration     time.Duration
}

type SourceSpec added in v1.0.4

type SourceSpec struct {
	Bucket         string
	Key            string
	Filter         string
	Region         string
	Endpoint       string
	VersionID      string
	ChecksumSHA256 string
}

func DecodeSourceSpec added in v1.0.4

func DecodeSourceSpec(spec *models.SpecConfig) (SourceSpec, error)

func (SourceSpec) ToMap added in v1.0.4

func (c SourceSpec) ToMap() map[string]interface{}

func (SourceSpec) Validate added in v1.0.4

func (c SourceSpec) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL