s3fs

package
v0.0.0-...-0b2bc0d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Unlicense Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxObjectSize = 8 * 1024 * 1024 * 1024 * 1024
	PartSize      = 8 * 1024 * 1024
	MaxNumParts   = 10000
)

Variables

This section is empty.

Functions

func GetEtag

func GetEtag(f vfs.File, partSize int64) (string, error)

Types

type ACL

type ACL string
const (
	Private           ACL = "private"
	PublicRead        ACL = "public-read"
	PublicReadWrite   ACL = "public-read-write"
	AuthenticatedRead ACL = "authenticated-read"
	BucketOwnerRead   ACL = "bucket-owner-read"
	BucketOwnerFull   ACL = "bucket-owner-full-control"
)

type FileInfo

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

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() interface{}
type Header http.Header

func (Header) ContentLength

func (h Header) ContentLength() (int64, error)

func (Header) ContentType

func (h Header) ContentType() string

func (Header) Date

func (h Header) Date() (time.Time, error)

func (Header) ETag

func (h Header) ETag() string

func (Header) LastModified

func (h Header) LastModified() (time.Time, error)

type Policy

type Policy policyMap

func (Policy) Conditions

func (p Policy) Conditions() *PolicyConditions

func (Policy) SetExpiration

func (p Policy) SetExpiration(seconds uint)

type PolicyConditions

type PolicyConditions []interface{}

func (*PolicyConditions) ACL

func (c *PolicyConditions) ACL(acl ACL)

func (*PolicyConditions) Bucket

func (c *PolicyConditions) Bucket(bucket string)

func (*PolicyConditions) ContentLengthRange

func (c *PolicyConditions) ContentLengthRange(from, to int)

func (*PolicyConditions) Equals

func (c *PolicyConditions) Equals(cond, match string)

func (*PolicyConditions) Redirect

func (c *PolicyConditions) Redirect(url string)

func (*PolicyConditions) StartsWith

func (c *PolicyConditions) StartsWith(cond, match string)

func (*PolicyConditions) SuccessActionRedirect

func (c *PolicyConditions) SuccessActionRedirect(url string)

type S3FS

type S3FS struct {
	// Bucket is the S3 bucket to use
	Bucket string
	// AccessKey is the S3 access key
	AccessKey string
	// Secret is the S3 secret
	Secret string
	Proto  string
	Host   string
	// contains filtered or unexported fields
}

A S3FS that prefixes the path in each vfs.Filesystem operation.

func Create

func Create(bucket, accessKey, secret, host, proto string) *S3FS

Create returns a file system

func (*S3FS) GetLifecycle

func (fs *S3FS) GetLifecycle()

func (*S3FS) Lstat

func (fs *S3FS) Lstat(name string) (os.FileInfo, error)

Lstat implements vfs.Filesystem.

func (*S3FS) Mkdir

func (fs *S3FS) Mkdir(name string, perm os.FileMode) error

Mkdir implements vfs.Filesystem.

func (*S3FS) OpenFile

func (fs *S3FS) OpenFile(name string, flag int, perm os.FileMode) (vfs.File, error)

OpenFile implements vfs.Filesystem.

func (*S3FS) PathSeparator

func (fs *S3FS) PathSeparator() uint8

PathSeparator implements vfs.Filesystem.

func (*S3FS) ReadDir

func (fs *S3FS) ReadDir(path string) ([]os.FileInfo, error)

ReadDir implements vfs.Filesystem.

func (*S3FS) Remove

func (fs *S3FS) Remove(name string) error

Remove implements vfs.Filesystem.

func (*S3FS) Rename

func (fs *S3FS) Rename(oldpath, newpath string) error

Rename implements vfs.Filesystem.

func (*S3FS) Stat

func (fs *S3FS) Stat(name string) (os.FileInfo, error)

Stat implements vfs.Filesystem.

type Stat

type Stat struct {
	Key          string
	LastModified string
	ETag         string // ETag value, without double quotes.
	Size         string
	StorageClass string
	OwnerID      string `xml:"Owner>ID"`
	OwnerName    string `xml:"Owner>DisplayName"`
}

Stat contains information about an S3 object or directory. It is the "underlying data source" returned by method Sys for each FileInfo produced by this package.

fi.Sys().(*s3util.Stat)

For the meaning of these fields, see http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html.

type Writer

type Writer interface {
	io.WriteCloser

	// Abort aborts the current write/upload operation
	Abort() error
}

Jump to

Keyboard shortcuts

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