model

package
v0.0.0-...-b4b5453 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const RequestTimeout time.Duration = time.Second * 30

Variables

View Source
var (
	MockFlag bool
)

Functions

func Acl

func Acl(bucket, key string) *s3.GetObjectAclOutput

func Detail

func Detail(bucket, key string) *s3.GetObjectOutput

func Download

func Download(bucket, key string, file io.WriterAt)

func Filename

func Filename(path string) string

func GetDownloadFilePath

func GetDownloadFilePath() (string, error)

func SaveDownloadFile

func SaveDownloadFile(dllFile *DownloadListFile) error

func Update

func Update(bucket, key string, body io.Reader) *s3.PutObjectOutput

Types

type DownloadItem

type DownloadItem struct {
	Filename     string `yaml:"filename"`
	S3Path       string `yaml:"s3_path"`
	DownloadPath string `yaml:"download_path"`
}

func NewDownloadItem

func NewDownloadItem(filename, s3Path, downloadPath string) *DownloadItem

type DownloadListFile

type DownloadListFile struct {
	Items []*DownloadItem `yaml:"items"`
}

func LoadDownloadFile

func LoadDownloadFile() (*DownloadListFile, error)

type Node

type Node struct {
	Key    string
	Parent *Node

	Objects  []*S3Object
	Position int
	// contains filtered or unexported fields
}

func NewNode

func NewNode(key string, parent *Node, objects []*S3Object) *Node

func (*Node) AddChild

func (n *Node) AddChild(key string, node *Node)

func (*Node) GetChild

func (n *Node) GetChild(key string) *Node

func (*Node) GetType

func (n *Node) GetType() S3ListType

func (*Node) IsBucketRoot

func (n *Node) IsBucketRoot() bool

func (*Node) IsExistChildren

func (n *Node) IsExistChildren(key string) bool

func (*Node) IsRoot

func (n *Node) IsRoot() bool

type S3ListType

type S3ListType int
const (
	BucketList S3ListType = iota //0
	BucketRootList
	ObjectList
)

type S3Object

type S3Object struct {
	ObjType S3ObjectType
	Name    string
	Date    *time.Time
	Size    *int64
}

func ListBuckets

func ListBuckets() []*S3Object

func ListObjects

func ListObjects(bucket, prefix string) []*S3Object

func NewS3Object

func NewS3Object(objType S3ObjectType, name string, date *time.Time, size *int64) *S3Object

type S3ObjectType

type S3ObjectType int
const (
	Bucket S3ObjectType = iota //0
	Dir
	PreDir
	Object
)

Jump to

Keyboard shortcuts

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