73 lines
1.4 KiB
Go
73 lines
1.4 KiB
Go
package operator
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
//"path"
|
|
)
|
|
|
|
// File exists
|
|
type FileExistsParams struct {
|
|
Filepath string
|
|
Source string
|
|
Dest string
|
|
}
|
|
type FileExistsResult struct{}
|
|
|
|
func (oper *Operator) FileExists(param *FileExistsParams) (int, *FileExistsResult, error) {
|
|
var err error
|
|
|
|
//filename := path.Base(param.Filepath)
|
|
//dirname := path.Dir(filepath)
|
|
|
|
res := &FileExistsResult{}
|
|
code := http.StatusOK
|
|
return code, res, err
|
|
}
|
|
|
|
// Put file
|
|
type PutFileParams struct {
|
|
ContentType string
|
|
ContentLength string
|
|
Filepath string
|
|
Source io.ReadCloser
|
|
}
|
|
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
|
|
}
|
|
type GetFileResult struct {
|
|
ContentType string
|
|
ContentLength string
|
|
Source io.ReadCloser
|
|
}
|
|
|
|
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
|
|
}
|