Documentation ¶
Index ¶
- Constants
- Variables
- func NewClient(conf *cloudstorage.Config) (*s3.S3, *session.Session, error)
- type FS
- func (f *FS) Client() interface{}
- func (f *FS) Delete(ctx context.Context, obj string) error
- func (f *FS) Folders(ctx context.Context, q cloudstorage.Query) ([]string, error)
- func (f *FS) Get(ctx context.Context, objectpath string) (cloudstorage.Object, error)
- func (f *FS) List(ctx context.Context, q cloudstorage.Query) (*cloudstorage.ObjectsResponse, error)
- func (f *FS) NewObject(objectname string) (cloudstorage.Object, error)
- func (f *FS) NewReader(o string) (io.ReadCloser, error)
- func (f *FS) NewReaderWithContext(ctx context.Context, objectname string) (io.ReadCloser, error)
- func (f *FS) NewWriter(objectName string, metadata map[string]string) (io.WriteCloser, error)
- func (f *FS) NewWriterWithContext(ctx context.Context, objectName string, metadata map[string]string, ...) (io.WriteCloser, error)
- func (f *FS) Objects(ctx context.Context, q cloudstorage.Query) (cloudstorage.ObjectIterator, error)
- func (f *FS) String() string
- func (f *FS) Type() string
Constants ¶
View Source
const ( // StoreType = "s3" this is used to define the storage type to create // from cloudstorage.NewStore(config) StoreType = "s3" // ConfKeyAccessKey config key name of the aws access_key(id) for auth ConfKeyAccessKey = "access_key" // ConfKeyAccessSecret config key name of the aws acccess secret ConfKeyAccessSecret = "access_secret" // ConfKeyARN config key name of the aws ARN name of user ConfKeyARN = "arn" // ConfKeyDisableSSL config key name of disabling ssl flag ConfKeyDisableSSL = "disable_ssl" // ConfKeyDebugLog config key to enable LogDebug log level ConfKeyDebugLog = "debug_log" // AuthAccessKey is for using aws access key/secret pairs AuthAccessKey cloudstorage.AuthMethod = "aws_access_key" )
Variables ¶
View Source
var ( // Retries number of times to retry upon failures. Retries = 3 // PageSize is default page size PageSize = 2000 // ErrNoS3Session no valid session ErrNoS3Session = fmt.Errorf("no valid aws session was created") // ErrNoAccessKey error for no access_key ErrNoAccessKey = fmt.Errorf("no settings.access_key") // ErrNoAccessSecret error for no settings.access_secret ErrNoAccessSecret = fmt.Errorf("no settings.access_secret") // ErrNoAuth error for no findable auth ErrNoAuth = fmt.Errorf("No auth provided") )
Functions ¶
Types ¶
type FS ¶
FS Simple wrapper for accessing s3 files, it doesn't currently implement a Reader/Writer interface so not useful for stream reading of large files yet.
func (*FS) Client ¶
func (f *FS) Client() interface{}
Client gets access to the underlying s3 cloud storage client.
func (*FS) List ¶
func (f *FS) List(ctx context.Context, q cloudstorage.Query) (*cloudstorage.ObjectsResponse, error)
List objects from this store.
func (*FS) NewObject ¶
func (f *FS) NewObject(objectname string) (cloudstorage.Object, error)
NewObject of Type s3.
func (*FS) NewReader ¶
func (f *FS) NewReader(o string) (io.ReadCloser, error)
NewReader create file reader.
func (*FS) NewReaderWithContext ¶
NewReaderWithContext create new File reader with context.
func (*FS) NewWriterWithContext ¶
func (f *FS) NewWriterWithContext(ctx context.Context, objectName string, metadata map[string]string, opts ...cloudstorage.Opts) (io.WriteCloser, error)
NewWriterWithContext create writer with provided context and metadata.
func (*FS) Objects ¶
func (f *FS) Objects(ctx context.Context, q cloudstorage.Query) (cloudstorage.ObjectIterator, error)
Objects returns an iterator over the objects in the s3 bucket that match the Query q. If q is nil, no filtering is done.
Click to show internal directories.
Click to hide internal directories.