s3

package
v0.0.0-...-d22e7c3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialsFromClient

func CredentialsFromClient(ctx context.Context, clientID, clientSecret, token string) (*credentials.Credentials, error)

CredentialsFromClient is a helper function with clientID and clientSecret provided from client

func CredentialsFromSharedProfile

func CredentialsFromSharedProfile(ctx context.Context, filename, profile string) (*credentials.Credentials, error)

CredentialsFromSharedProfile is a helper function to load credentials from a profile file usually the profile file located at $HOME/.aws/profile

Types

type Config

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

Config of S3

func NewConfig

func NewConfig(ctx context.Context, creds *credentials.Credentials) (*Config, error)

NewConfig return new configuration for s3

func (*Config) DisableSSL

func (c *Config) DisableSSL(disable bool) *Config

DisableSSL to disable SSL when connecting to s3

func (*Config) ForcePathStyle

func (c *Config) ForcePathStyle(force bool) *Config

ForcePathStyle when get/put object from s3

func (*Config) SetBucket

func (c *Config) SetBucket(bucket string) *Config

SetBucket for storing s3 bucket information

func (*Config) SetBucketProto

func (c *Config) SetBucketProto(proto string) *Config

SetBucketProto to set the proto when connecting to s3 bucket

func (*Config) SetBucketURL

func (c *Config) SetBucketURL(url string) *Config

SetBucketURL for s3

func (*Config) SetEndpoint

func (c *Config) SetEndpoint(endpoint string) *Config

SetEndpoint to set s3 endpoint

func (*Config) SetRegion

func (c *Config) SetRegion(region string) *Config

SetRegion to set s3 region

type S3

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

S3 struct

func New

func New(ctx context.Context, config *Config) (*S3, error)

New S3 storage

func (*S3) Bucket

func (s3 *S3) Bucket() *blob.Bucket

Bucket function

func (*S3) BucketName

func (s3 *S3) BucketName() string

BucketName return name of bucket used for objectstorage

func (*S3) BucketURL

func (s3 *S3) BucketURL() string

BucketURL return full path for bucket

func (*S3) Close

func (s3 *S3) Close() error

Close will close the s3 bucket and return error

func (*S3) Name

func (s3 *S3) Name() string

Name of objectstorage provider

Jump to

Keyboard shortcuts

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