working commit
This commit is contained in:
+52
-9
@@ -1,19 +1,62 @@
|
||||
package operator
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type FileExistsParams struct{}
|
||||
|
||||
type FileExistsResult struct {
|
||||
Code int
|
||||
// File exists
|
||||
type FileExistsParams struct {
|
||||
Filepath string
|
||||
Source string
|
||||
Dest string
|
||||
}
|
||||
type FileExistsResult struct{}
|
||||
|
||||
func (oper *Operator) FileExists(param *FileExistsParams) (*FileExistsResult, error) {
|
||||
func (oper *Operator) FileExists(param *FileExistsParams) (int, *FileExistsResult, error) {
|
||||
var err error
|
||||
res := &FileExistsResult{
|
||||
Code: http.StatusOK,
|
||||
}
|
||||
return res, err
|
||||
res := &FileExistsResult{}
|
||||
code := http.StatusOK
|
||||
return code, res, err
|
||||
}
|
||||
|
||||
// Put file
|
||||
type PutFileParams struct {
|
||||
Filepath string
|
||||
Source string
|
||||
}
|
||||
type PutFileResult struct{}
|
||||
|
||||
func (oper *Operator) PutFile(param *PutFileParams) (int, *PutFileResult, error) {
|
||||
var err error
|
||||
res := &PutFileResult{}
|
||||
code := http.StatusOK
|
||||
return code, res, err
|
||||
}
|
||||
|
||||
// Get file
|
||||
type GetFileParams struct {
|
||||
Filepath string
|
||||
Dest io.Writer
|
||||
}
|
||||
type GetFileResult struct{}
|
||||
|
||||
func (oper *Operator) GetFile(param *GetFileParams) (int, *GetFileResult, error) {
|
||||
var err error
|
||||
res := &GetFileResult{}
|
||||
code := http.StatusOK
|
||||
return code, res, err
|
||||
}
|
||||
|
||||
// Delete file
|
||||
type DeleteFileParams struct {
|
||||
Filepath string
|
||||
}
|
||||
type DeleteFileResult struct{}
|
||||
|
||||
func (oper *Operator) DeleteFile(param *DeleteFileParams) (int, *DeleteFileResult, error) {
|
||||
var err error
|
||||
res := &DeleteFileResult{}
|
||||
code := http.StatusOK
|
||||
return code, res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user