disk

package
v1.0.0-...-a0f063d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFileNum = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

func NewFile

func NewFile(file string) (*File, error)

func NewFileFromRequest

func NewFileFromRequest(fileHeader *multipart.FileHeader) (*File, error)

func (*File) Disk

func (f *File) Disk(disk string) filesystem.File

func (*File) Extension

func (f *File) Extension() (string, error)

func (*File) File

func (f *File) File() string

func (*File) GetClientOriginalExtension

func (f *File) GetClientOriginalExtension() string

func (*File) GetClientOriginalName

func (f *File) GetClientOriginalName() string

func (*File) HashName

func (f *File) HashName(path ...string) string

func (*File) Store

func (f *File) Store(path string) (string, error)

func (*File) StoreAs

func (f *File) StoreAs(path string, name string) (string, error)

type Local

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

func NewLocal

func NewLocal(disk string) (*Local, error)

func (*Local) AllDirectories

func (r *Local) AllDirectories(path string) ([]string, error)

func (*Local) AllFiles

func (r *Local) AllFiles(path string) ([]string, error)

func (*Local) Copy

func (r *Local) Copy(originFile, targetFile string) error

func (*Local) Delete

func (r *Local) Delete(files ...string) error

func (*Local) DeleteDirectory

func (r *Local) DeleteDirectory(directory string) error

func (*Local) Directories

func (r *Local) Directories(path string) ([]string, error)

func (*Local) Disk

func (r *Local) Disk(disk string) filesystem.IStorage

func (*Local) Exists

func (r *Local) Exists(file string) bool

func (*Local) Files

func (r *Local) Files(path string) ([]string, error)

func (*Local) Get

func (r *Local) Get(file string) (string, error)

func (*Local) MakeDirectory

func (r *Local) MakeDirectory(directory string) error

func (*Local) Missing

func (r *Local) Missing(file string) bool

func (*Local) Move

func (r *Local) Move(oldFile, newFile string) error

func (*Local) Path

func (r *Local) Path(file string) string

func (*Local) Put

func (r *Local) Put(file, content string) error

func (*Local) PutFile

func (r *Local) PutFile(filePath string, source filesystem.File) (string, error)

func (*Local) PutFileAs

func (r *Local) PutFileAs(filePath string, source filesystem.File, name string) (string, error)

func (*Local) Size

func (r *Local) Size(file string) (int64, error)

func (*Local) TemporaryUrl

func (r *Local) TemporaryUrl(file string, time time.Time) (string, error)

func (*Local) Url

func (r *Local) Url(file string) string

func (*Local) WithContext

func (r *Local) WithContext(ctx context.Context) filesystem.IStorage

type S3

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

func NewS3

func NewS3(ctx context.Context, disk string) (*S3, error)

func (*S3) AllDirectories

func (r *S3) AllDirectories(path string) ([]string, error)

func (*S3) AllFiles

func (r *S3) AllFiles(path string) ([]string, error)

func (*S3) Copy

func (r *S3) Copy(originFile, targetFile string) error

func (*S3) Delete

func (r *S3) Delete(files ...string) error

func (*S3) DeleteDirectory

func (r *S3) DeleteDirectory(directory string) error

func (*S3) Directories

func (r *S3) Directories(path string) ([]string, error)

func (*S3) Disk

func (r *S3) Disk(disk string) filesystem.IStorage

func (*S3) Exists

func (r *S3) Exists(file string) bool

func (*S3) Files

func (r *S3) Files(path string) ([]string, error)

func (*S3) Get

func (r *S3) Get(file string) (string, error)

func (*S3) MakeDirectory

func (r *S3) MakeDirectory(directory string) error

func (*S3) Missing

func (r *S3) Missing(file string) bool

func (*S3) Move

func (r *S3) Move(oldFile, newFile string) error

func (*S3) Path

func (r *S3) Path(file string) string

func (*S3) Put

func (r *S3) Put(file string, content string) error

func (*S3) PutFile

func (r *S3) PutFile(filePath string, source filesystem.File) (string, error)

func (*S3) PutFileAs

func (r *S3) PutFileAs(filePath string, source filesystem.File, name string) (string, error)

func (*S3) Size

func (r *S3) Size(file string) (int64, error)

func (*S3) TemporaryUrl

func (r *S3) TemporaryUrl(file string, time time.Time) (string, error)

func (*S3) Url

func (r *S3) Url(file string) string

func (*S3) WithContext

func (r *S3) WithContext(ctx context.Context) filesystem.IStorage

Jump to

Keyboard shortcuts

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