model

package
v0.0.0-...-d2c8d63 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(cf Config, update bool) (aws.Config, error)

GetConfig ...

func GetDownloader

func GetDownloader(client *s3.Client) *s3m.Downloader

Types

type Config

type Config struct {
	Url       string
	Region    *string
	AccessKey string
	SecretKey string
	SSl       bool
}

func NewConfig

func NewConfig(url string, region *string, accKey string, secKey string, ssl bool) Config

type FType

type FType int8
const (
	File FType = iota
	Folder
	Bucket
)

type Model

type Model struct {
	Config     *aws.Config
	Client     *s3.Client
	Downloader *s3m.Downloader
	Cf         *Config
}

func NewModel

func NewModel(cf Config) *Model

func (*Model) CreateBucket

func (m *Model) CreateBucket(name *string) error

func (*Model) CreateFolder

func (m *Model) CreateFolder(name *string, bucket *Object) error

func (*Model) Delete

func (m *Model) Delete(key *string, bucket *Object) error

func (*Model) DeleteBucket

func (m *Model) DeleteBucket(name *string) error

func (*Model) Download

func (m *Model) Download(object s3t.Object, currentPath string, destPath string, bucket *string) (n int64, err error)

func (*Model) GetBucketLocation

func (m *Model) GetBucketLocation(name *string) (*string, error)

func (*Model) List

func (m *Model) List(path string, bucket *Object) ([]*Object, error)

func (*Model) ListBuckets

func (m *Model) ListBuckets() ([]*Object, error)

func (*Model) ListObjects

func (m *Model) ListObjects(key string, bucket *Object) []s3t.Object

func (*Model) RefreshClient

func (m *Model) RefreshClient(bucket *string)

type Object

type Object struct {
	Key          *string
	Ot           FType
	Etag         *string
	Size         *int64
	StorageClass *string
	LastModified *time.Time
	FullPath     *string
}

Jump to

Keyboard shortcuts

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