levels3

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CacheSize = 500

Variables

This section is empty.

Functions

func NewS3Storage

func NewS3Storage(opt OpenOption) (storage.Storage, error)

NewS3Storage returns a new s3-backed storage implementation.

Types

type OpenOption

type OpenOption struct {
	Bucket        string
	Path          string
	Ak            string
	Sk            string
	Region        string
	Endpoint      string
	LocalCacheDir string
}

type S3Client

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

func GetS3Client

func GetS3Client(opt OpenOption) (*S3Client, error)

func (*S3Client) GetBytes

func (client *S3Client) GetBytes(key string) ([]byte, error)

func (*S3Client) List

func (client *S3Client) List() ([]storage.FileDesc, error)

func (*S3Client) PutBytes

func (client *S3Client) PutBytes(key string, data []byte) error

func (*S3Client) Remove

func (client *S3Client) Remove(key string) error

type S3Storage

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

S3Storage is a s3-backed storage.

func (*S3Storage) Close

func (ms *S3Storage) Close() error

func (*S3Storage) Create

func (ms *S3Storage) Create(fd storage.FileDesc) (storage.Writer, error)

func (*S3Storage) GetMeta

func (ms *S3Storage) GetMeta() (storage.FileDesc, error)

func (*S3Storage) List

func (ms *S3Storage) List(ft storage.FileType) ([]storage.FileDesc, error)

func (*S3Storage) Lock

func (ms *S3Storage) Lock() (storage.Locker, error)

func (*S3Storage) Log

func (ms *S3Storage) Log(message string)

func (*S3Storage) Open

func (ms *S3Storage) Open(fd storage.FileDesc) (storage.Reader, error)

func (*S3Storage) Remove

func (ms *S3Storage) Remove(fd storage.FileDesc) error

func (*S3Storage) Rename

func (ms *S3Storage) Rename(oldfd, newfd storage.FileDesc) error

func (*S3Storage) SetMeta

func (ms *S3Storage) SetMeta(fd storage.FileDesc) error

type S3StorageLock

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

func (*S3StorageLock) Unlock

func (lock *S3StorageLock) Unlock()

Jump to

Keyboard shortcuts

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