file

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

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(s *structs.AppCtx) *File

func (*File) Download

func (f *File) Download(ctx context.Context, fileID string) ([]byte, error)

func (*File) DownloadAvatar

func (f *File) DownloadAvatar(ctx context.Context, imageID string) ([]byte, error)

func (*File) UploadAvatarByBuffer

func (f *File) UploadAvatarByBuffer(ctx context.Context, fileName string, buffer []byte) (*structs.Avatar, error)

func (*File) UploadAvatarByPath

func (f *File) UploadAvatarByPath(ctx context.Context, fileName, path string) (*structs.Avatar, error)

func (*File) UploadAvatarByReader

func (f *File) UploadAvatarByReader(ctx context.Context, fileName string, reader io.Reader) (*structs.Avatar, error)

func (*File) UploadByBuffer

func (f *File) UploadByBuffer(ctx context.Context, fileName string, buffer []byte) (*structs.FileUploadResult, error)

func (*File) UploadByPath

func (f *File) UploadByPath(ctx context.Context, fileName, path string) (*structs.FileUploadResult, error)

func (*File) UploadByReader

func (f *File) UploadByReader(ctx context.Context, fileName string, reader io.Reader) (*structs.FileUploadResult, error)

type IFile

type IFile interface {
	UploadByPath(ctx context.Context, fileName, path string) (*structs.FileUploadResult, error)
	UploadByReader(ctx context.Context, fileName string, reader io.Reader) (*structs.FileUploadResult, error)
	UploadByBuffer(ctx context.Context, fileName string, buffer []byte) (*structs.FileUploadResult, error)
	UploadAvatarByPath(ctx context.Context, fileName, path string) (*structs.Avatar, error)
	UploadAvatarByReader(ctx context.Context, fileName string, reader io.Reader) (*structs.Avatar, error)
	UploadAvatarByBuffer(ctx context.Context, fileName string, buffer []byte) (*structs.Avatar, error)
	Download(ctx context.Context, fileID string) ([]byte, error)
	DownloadAvatar(ctx context.Context, imageID string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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