Documentation ¶
Index ¶
- type File
- func (f *File) Download(ctx context.Context, fileID string) ([]byte, error)
- func (f *File) UploadByBuffer(ctx context.Context, fileName string, buffer []byte, expire time.Duration) (*structs.Attachment, error)
- func (f *File) UploadByPath(ctx context.Context, fileName, path string, expire time.Duration) (*structs.Attachment, error)
- func (f *File) UploadByReader(ctx context.Context, fileName string, reader io.Reader, expire time.Duration) (*structs.Attachment, error)
- type IFile
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 (*File) UploadByBuffer ¶
func (*File) UploadByPath ¶
type IFile ¶
type IFile interface { // UploadByPath 精度是 second, 0 值不过期 UploadByPath(ctx context.Context, fileName, path string, expire time.Duration) (*structs.Attachment, error) // UploadByReader 精度是 second, 0 值不过期 UploadByReader(ctx context.Context, fileName string, reader io.Reader, expire time.Duration) (*structs.Attachment, error) // UploadByBuffer 精度是 second, 0 值不过期 UploadByBuffer(ctx context.Context, fileName string, buffer []byte, expire time.Duration) (*structs.Attachment, error) Download(ctx context.Context, fileID string) ([]byte, error) }
Click to show internal directories.
Click to hide internal directories.