uploader

package
v5.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package uploader is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var WireUploader = wire.NewSet(NewUploader)

Functions

This section is empty.

Types

type File

type File interface {
	io.ReadWriteCloser
	io.StringWriter
	Name() string
	Stat() (os.FileInfo, error)
	Seek(offset int64, whence int) (ret int64, err error)
}

type FileInfo

type FileInfo interface {
	Path() string
	Size() uint64
	LastModified() time.Time
}

func NewFileInfo

func NewFileInfo[T uint64 | int64 | int](path string, size T, lastModified time.Time) FileInfo

type MockFile

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

MockFile is a mock of File interface.

func NewMockFile

func NewMockFile(ctrl *gomock.Controller) *MockFile

NewMockFile creates a new mock instance.

func (*MockFile) Close

func (m *MockFile) Close() error

Close mocks base method.

func (*MockFile) EXPECT

func (m *MockFile) EXPECT() *MockFileMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFile) Name

func (m *MockFile) Name() string

Name mocks base method.

func (*MockFile) Read

func (m *MockFile) Read(arg0 []byte) (int, error)

Read mocks base method.

func (*MockFile) Seek

func (m *MockFile) Seek(arg0 int64, arg1 int) (int64, error)

Seek mocks base method.

func (*MockFile) Stat

func (m *MockFile) Stat() (fs.FileInfo, error)

Stat mocks base method.

func (*MockFile) Write

func (m *MockFile) Write(arg0 []byte) (int, error)

Write mocks base method.

func (*MockFile) WriteString

func (m *MockFile) WriteString(arg0 string) (int, error)

WriteString mocks base method.

type MockFileInfo

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

MockFileInfo is a mock of FileInfo interface.

func NewMockFileInfo

func NewMockFileInfo(ctrl *gomock.Controller) *MockFileInfo

NewMockFileInfo creates a new mock instance.

func (*MockFileInfo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFileInfo) LastModified

func (m *MockFileInfo) LastModified() time.Time

LastModified mocks base method.

func (*MockFileInfo) Path

func (m *MockFileInfo) Path() string

Path mocks base method.

func (*MockFileInfo) Size

func (m *MockFileInfo) Size() uint64

Size mocks base method.

type MockFileInfoMockRecorder

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

MockFileInfoMockRecorder is the mock recorder for MockFileInfo.

func (*MockFileInfoMockRecorder) LastModified

func (mr *MockFileInfoMockRecorder) LastModified() *gomock.Call

LastModified indicates an expected call of LastModified.

func (*MockFileInfoMockRecorder) Path

func (mr *MockFileInfoMockRecorder) Path() *gomock.Call

Path indicates an expected call of Path.

func (*MockFileInfoMockRecorder) Size

func (mr *MockFileInfoMockRecorder) Size() *gomock.Call

Size indicates an expected call of Size.

type MockFileMockRecorder

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

MockFileMockRecorder is the mock recorder for MockFile.

func (*MockFileMockRecorder) Close

func (mr *MockFileMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockFileMockRecorder) Name

func (mr *MockFileMockRecorder) Name() *gomock.Call

Name indicates an expected call of Name.

func (*MockFileMockRecorder) Read

func (mr *MockFileMockRecorder) Read(arg0 any) *gomock.Call

Read indicates an expected call of Read.

func (*MockFileMockRecorder) Seek

func (mr *MockFileMockRecorder) Seek(arg0, arg1 any) *gomock.Call

Seek indicates an expected call of Seek.

func (*MockFileMockRecorder) Stat

func (mr *MockFileMockRecorder) Stat() *gomock.Call

Stat indicates an expected call of Stat.

func (*MockFileMockRecorder) Write

func (mr *MockFileMockRecorder) Write(arg0 any) *gomock.Call

Write indicates an expected call of Write.

func (*MockFileMockRecorder) WriteString

func (mr *MockFileMockRecorder) WriteString(arg0 any) *gomock.Call

WriteString indicates an expected call of WriteString.

type MockUploader

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

MockUploader is a mock of Uploader interface.

func NewMockUploader

func NewMockUploader(ctrl *gomock.Controller) *MockUploader

NewMockUploader creates a new mock instance.

func (*MockUploader) AbsolutePath

func (m *MockUploader) AbsolutePath(arg0 string) string

AbsolutePath mocks base method.

func (*MockUploader) AllDirectoryFiles

func (m *MockUploader) AllDirectoryFiles(arg0 string) ([]FileInfo, error)

AllDirectoryFiles mocks base method.

func (*MockUploader) Delete

func (m *MockUploader) Delete(arg0 string) error

Delete mocks base method.

func (*MockUploader) DeleteDir

func (m *MockUploader) DeleteDir(arg0 string) error

DeleteDir mocks base method.

func (*MockUploader) DirSize

func (m *MockUploader) DirSize() (int64, error)

DirSize mocks base method.

func (*MockUploader) Disk

func (m *MockUploader) Disk(arg0 string) Uploader

Disk mocks base method.

func (*MockUploader) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUploader) Exists

func (m *MockUploader) Exists(arg0 string) bool

Exists mocks base method.

func (*MockUploader) LocalUploader

func (m *MockUploader) LocalUploader() Uploader

LocalUploader mocks base method.

func (*MockUploader) MkDir

func (m *MockUploader) MkDir(arg0 string, arg1 bool) error

MkDir mocks base method.

func (*MockUploader) NewFile

func (m *MockUploader) NewFile(arg0 string) (File, error)

NewFile mocks base method.

func (*MockUploader) Put

func (m *MockUploader) Put(arg0 string, arg1 io.Reader) (FileInfo, error)

Put mocks base method.

func (*MockUploader) Read

func (m *MockUploader) Read(arg0 string) (io.ReadCloser, error)

Read mocks base method.

func (*MockUploader) RemoveEmptyDir

func (m *MockUploader) RemoveEmptyDir() error

RemoveEmptyDir mocks base method.

func (*MockUploader) Stat

func (m *MockUploader) Stat(arg0 string) (FileInfo, error)

Stat mocks base method.

func (*MockUploader) Type

Type mocks base method.

func (*MockUploader) UnWrap

func (m *MockUploader) UnWrap() Uploader

UnWrap mocks base method.

type MockUploaderMockRecorder

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

MockUploaderMockRecorder is the mock recorder for MockUploader.

func (*MockUploaderMockRecorder) AbsolutePath

func (mr *MockUploaderMockRecorder) AbsolutePath(arg0 any) *gomock.Call

AbsolutePath indicates an expected call of AbsolutePath.

func (*MockUploaderMockRecorder) AllDirectoryFiles

func (mr *MockUploaderMockRecorder) AllDirectoryFiles(arg0 any) *gomock.Call

AllDirectoryFiles indicates an expected call of AllDirectoryFiles.

func (*MockUploaderMockRecorder) Delete

func (mr *MockUploaderMockRecorder) Delete(arg0 any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockUploaderMockRecorder) DeleteDir

func (mr *MockUploaderMockRecorder) DeleteDir(arg0 any) *gomock.Call

DeleteDir indicates an expected call of DeleteDir.

func (*MockUploaderMockRecorder) DirSize

func (mr *MockUploaderMockRecorder) DirSize() *gomock.Call

DirSize indicates an expected call of DirSize.

func (*MockUploaderMockRecorder) Disk

func (mr *MockUploaderMockRecorder) Disk(arg0 any) *gomock.Call

Disk indicates an expected call of Disk.

func (*MockUploaderMockRecorder) Exists

func (mr *MockUploaderMockRecorder) Exists(arg0 any) *gomock.Call

Exists indicates an expected call of Exists.

func (*MockUploaderMockRecorder) LocalUploader

func (mr *MockUploaderMockRecorder) LocalUploader() *gomock.Call

LocalUploader indicates an expected call of LocalUploader.

func (*MockUploaderMockRecorder) MkDir

func (mr *MockUploaderMockRecorder) MkDir(arg0, arg1 any) *gomock.Call

MkDir indicates an expected call of MkDir.

func (*MockUploaderMockRecorder) NewFile

func (mr *MockUploaderMockRecorder) NewFile(arg0 any) *gomock.Call

NewFile indicates an expected call of NewFile.

func (*MockUploaderMockRecorder) Put

func (mr *MockUploaderMockRecorder) Put(arg0, arg1 any) *gomock.Call

Put indicates an expected call of Put.

func (*MockUploaderMockRecorder) Read

func (mr *MockUploaderMockRecorder) Read(arg0 any) *gomock.Call

Read indicates an expected call of Read.

func (*MockUploaderMockRecorder) RemoveEmptyDir

func (mr *MockUploaderMockRecorder) RemoveEmptyDir() *gomock.Call

RemoveEmptyDir indicates an expected call of RemoveEmptyDir.

func (*MockUploaderMockRecorder) Stat

func (mr *MockUploaderMockRecorder) Stat(arg0 any) *gomock.Call

Stat indicates an expected call of Stat.

func (*MockUploaderMockRecorder) Type

func (mr *MockUploaderMockRecorder) Type() *gomock.Call

Type indicates an expected call of Type.

func (*MockUploaderMockRecorder) UnWrap

func (mr *MockUploaderMockRecorder) UnWrap() *gomock.Call

UnWrap indicates an expected call of UnWrap.

type Uploader

type Uploader interface {
	Disk(string) Uploader
	Type() schematype.UploadType
	DeleteDir(dir string) error
	DirSize() (int64, error)
	Delete(path string) error
	Exists(path string) bool
	MkDir(path string, recursive bool) error
	AbsolutePath(path string) string
	Put(path string, content io.Reader) (FileInfo, error)
	Read(string string) (io.ReadCloser, error)
	Stat(file string) (FileInfo, error)
	AllDirectoryFiles(dir string) ([]FileInfo, error)
	NewFile(path string) (File, error)
	RemoveEmptyDir() error
	UnWrap() Uploader
	LocalUploader() Uploader
}

func NewDiskUploader

func NewDiskUploader(rootDir string, logger mlog.Logger) (Uploader, error)

func NewS3

func NewS3(data data.Data, bucket string, uploader Uploader, rootDir string) Uploader

NewS3 creates a new S3 uploader with the specified parameters.

func NewUploader

func NewUploader(cfg *config.Config, logger mlog.Logger, data data.Data) (Uploader, error)

Jump to

Keyboard shortcuts

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