Documentation ¶
Overview ¶
Package upload is a generated GoMock package.
Index ¶
- Variables
- type FileUpload
- func (u *FileUpload) Close() error
- func (u *FileUpload) Delete(path string) error
- func (u *FileUpload) Handler(root string) http.Handler
- func (u *FileUpload) Info() map[string]interface{}
- func (u *FileUpload) Prepare() (Upload, error)
- func (u *FileUpload) Upload(path, ctype string, content []byte) error
- type MockUpload
- func (m *MockUpload) Close() error
- func (m *MockUpload) Delete(arg0 string) error
- func (m *MockUpload) EXPECT() *MockUploadMockRecorder
- func (m *MockUpload) Handler(arg0 string) http.Handler
- func (m *MockUpload) Info() map[string]interface{}
- func (m *MockUpload) Prepare() (Upload, error)
- func (m *MockUpload) Upload(arg0, arg1 string, arg2 []byte) error
- type MockUploadMockRecorder
- func (mr *MockUploadMockRecorder) Close() *gomock.Call
- func (mr *MockUploadMockRecorder) Delete(arg0 interface{}) *gomock.Call
- func (mr *MockUploadMockRecorder) Handler(arg0 interface{}) *gomock.Call
- func (mr *MockUploadMockRecorder) Info() *gomock.Call
- func (mr *MockUploadMockRecorder) Prepare() *gomock.Call
- func (mr *MockUploadMockRecorder) Upload(arg0, arg1, arg2 interface{}) *gomock.Call
- type S3Upload
- type Upload
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknownDriver defines a named error for unknown upload drivers. ErrUnknownDriver = fmt.Errorf("unknown upload driver") )
Functions ¶
This section is empty.
Types ¶
type FileUpload ¶
type FileUpload struct {
// contains filtered or unexported fields
}
FileUpload implements the Upload interface.
func (*FileUpload) Close ¶
func (u *FileUpload) Close() error
Close simply closes the upload handler.
func (*FileUpload) Delete ¶
func (u *FileUpload) Delete(path string) error
Delete removes an attachment from the defined S3 bucket.
func (*FileUpload) Handler ¶
func (u *FileUpload) Handler(root string) http.Handler
Handler implements an HTTP handler for asset uploads.
func (*FileUpload) Info ¶
func (u *FileUpload) Info() map[string]interface{}
Info prepares some informational message about the handler.
func (*FileUpload) Prepare ¶
func (u *FileUpload) Prepare() (Upload, error)
Prepare simply prepares the upload handler.
type MockUpload ¶
type MockUpload struct {
// contains filtered or unexported fields
}
MockUpload is a mock of Upload interface.
func NewMockUpload ¶
func NewMockUpload(ctrl *gomock.Controller) *MockUpload
NewMockUpload creates a new mock instance.
func (*MockUpload) Delete ¶
func (m *MockUpload) Delete(arg0 string) error
Delete mocks base method.
func (*MockUpload) EXPECT ¶
func (m *MockUpload) EXPECT() *MockUploadMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUpload) Handler ¶
func (m *MockUpload) Handler(arg0 string) http.Handler
Handler mocks base method.
func (*MockUpload) Info ¶
func (m *MockUpload) Info() map[string]interface{}
Info mocks base method.
func (*MockUpload) Prepare ¶
func (m *MockUpload) Prepare() (Upload, error)
Prepare mocks base method.
type MockUploadMockRecorder ¶
type MockUploadMockRecorder struct {
// contains filtered or unexported fields
}
MockUploadMockRecorder is the mock recorder for MockUpload.
func (*MockUploadMockRecorder) Close ¶
func (mr *MockUploadMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockUploadMockRecorder) Delete ¶
func (mr *MockUploadMockRecorder) Delete(arg0 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockUploadMockRecorder) Handler ¶
func (mr *MockUploadMockRecorder) Handler(arg0 interface{}) *gomock.Call
Handler indicates an expected call of Handler.
func (*MockUploadMockRecorder) Info ¶
func (mr *MockUploadMockRecorder) Info() *gomock.Call
Info indicates an expected call of Info.
func (*MockUploadMockRecorder) Prepare ¶
func (mr *MockUploadMockRecorder) Prepare() *gomock.Call
Prepare indicates an expected call of Prepare.
func (*MockUploadMockRecorder) Upload ¶
func (mr *MockUploadMockRecorder) Upload(arg0, arg1, arg2 interface{}) *gomock.Call
Upload indicates an expected call of Upload.
type S3Upload ¶
type S3Upload struct {
// contains filtered or unexported fields
}
S3Upload implements the Upload interface.
type Upload ¶
type Upload interface { Info() map[string]interface{} Prepare() (Upload, error) Close() error Upload(string, string, []byte) error Delete(string) error Handler(string) http.Handler }
Upload provides the interface for the upload implementations.
func MustFileUpload ¶
MustFileUpload simply calls NewFileUpload and panics on an error.
func MustS3Upload ¶
MustS3Upload simply calls NewS3Upload and panics on an error.
func NewFileUpload ¶
NewFileUpload initializes a new file handler.