right type used
This commit is contained in:
+13
-13
@@ -22,9 +22,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"mstore/pkg/auxtool"
|
||||
"mstore/pkg/auxuuid"
|
||||
"mstore/pkg/descr"
|
||||
"mstore/pkg/terms"
|
||||
"mstore/pkg/uuid"
|
||||
)
|
||||
|
||||
// FileInfo
|
||||
@@ -41,9 +41,9 @@ type FileInfoResult struct {
|
||||
ContentDigest string
|
||||
|
||||
ContentCreatedAt string
|
||||
ContentCreatedBy auxuuid.UUID
|
||||
ContentCreatedBy uuid.UUID
|
||||
ContentUpdatedAt string
|
||||
ContentUpdatedBy auxuuid.UUID
|
||||
ContentUpdatedBy uuid.UUID
|
||||
}
|
||||
|
||||
func cleanFilepath(filename string) (string, error) {
|
||||
@@ -51,7 +51,7 @@ func cleanFilepath(filename string) (string, error) {
|
||||
return filepath.Clean(filename), nil
|
||||
}
|
||||
|
||||
func (oper *Operator) FileInfo(ctx context.Context, operatorID auxuuid.UUID, param *FileInfoParams) (int, *FileInfoResult, error) {
|
||||
func (oper *Operator) FileInfo(ctx context.Context, operatorID uuid.UUID, param *FileInfoParams) (int, *FileInfoResult, error) {
|
||||
var err error
|
||||
code := http.StatusOK
|
||||
res := &FileInfoResult{}
|
||||
@@ -101,7 +101,7 @@ type PutFileResult struct{}
|
||||
const defaultContentType = "application/octet-stream"
|
||||
|
||||
// TODO: checking catalog and file names conflict
|
||||
func (oper *Operator) PutFile(ctx context.Context, operatorID auxuuid.UUID, param *PutFileParams) (int, *PutFileResult, error) {
|
||||
func (oper *Operator) PutFile(ctx context.Context, operatorID uuid.UUID, param *PutFileParams) (int, *PutFileResult, error) {
|
||||
var err error
|
||||
res := &PutFileResult{}
|
||||
|
||||
@@ -155,7 +155,7 @@ func (oper *Operator) PutFile(ctx context.Context, operatorID auxuuid.UUID, para
|
||||
}
|
||||
} else {
|
||||
fileDescr = &descr.File{
|
||||
ID: auxuuid.NewUUID(),
|
||||
ID: uuid.NewUUID(),
|
||||
Name: filename,
|
||||
Collection: collection,
|
||||
Size: size,
|
||||
@@ -193,12 +193,12 @@ type GetFileResult struct {
|
||||
Source io.ReadCloser
|
||||
|
||||
ContentCreatedAt string
|
||||
ContentCreatedBy auxuuid.UUID
|
||||
ContentCreatedBy uuid.UUID
|
||||
ContentUpdatedAt string
|
||||
ContentUpdatedBy auxuuid.UUID
|
||||
ContentUpdatedBy uuid.UUID
|
||||
}
|
||||
|
||||
func (oper *Operator) GetFile(ctx context.Context, operatorID auxuuid.UUID, param *GetFileParams) (int, *GetFileResult, error) {
|
||||
func (oper *Operator) GetFile(ctx context.Context, operatorID uuid.UUID, param *GetFileParams) (int, *GetFileResult, error) {
|
||||
var err error
|
||||
res := &GetFileResult{}
|
||||
|
||||
@@ -247,7 +247,7 @@ type DeleteFileParams struct {
|
||||
}
|
||||
type DeleteFileResult struct{}
|
||||
|
||||
func (oper *Operator) DeleteFile(ctx context.Context, operatorID auxuuid.UUID, param *DeleteFileParams) (int, *DeleteFileResult, error) {
|
||||
func (oper *Operator) DeleteFile(ctx context.Context, operatorID uuid.UUID, param *DeleteFileParams) (int, *DeleteFileResult, error) {
|
||||
var err error
|
||||
res := &DeleteFileResult{}
|
||||
code := http.StatusOK
|
||||
@@ -294,7 +294,7 @@ type ListFilesResult struct {
|
||||
Files []descr.File `json:"files,omitempty"`
|
||||
}
|
||||
|
||||
func (oper *Operator) ListFiles(ctx context.Context, operatorID auxuuid.UUID, params *ListFilesParams) (int, *ListFilesResult, error) {
|
||||
func (oper *Operator) ListFiles(ctx context.Context, operatorID uuid.UUID, params *ListFilesParams) (int, *ListFilesResult, error) {
|
||||
var err error
|
||||
res := &ListFilesResult{
|
||||
Files: make([]descr.File, 0),
|
||||
@@ -406,7 +406,7 @@ type ListCollectionsResult struct {
|
||||
Collections []string `json:"collection,omitempty"`
|
||||
}
|
||||
|
||||
func (oper *Operator) ListCollections(ctx context.Context, operatorID auxuuid.UUID, param *ListCollectionsParams) (int, *ListCollectionsResult, error) {
|
||||
func (oper *Operator) ListCollections(ctx context.Context, operatorID uuid.UUID, param *ListCollectionsParams) (int, *ListCollectionsResult, error) {
|
||||
var err error
|
||||
res := &ListCollectionsResult{
|
||||
Collections: make([]string, 0),
|
||||
@@ -539,7 +539,7 @@ type DeleteColletionResult struct {
|
||||
Files []descr.File `json:"files,omitempty"`
|
||||
}
|
||||
|
||||
func (oper *Operator) DeleteColletion(ctx context.Context, operatorID auxuuid.UUID, param *DeleteColletionParams) (int, *DeleteColletionResult, error) {
|
||||
func (oper *Operator) DeleteColletion(ctx context.Context, operatorID uuid.UUID, param *DeleteColletionParams) (int, *DeleteColletionResult, error) {
|
||||
var err error
|
||||
res := &DeleteColletionResult{
|
||||
Files: make([]descr.File, 0),
|
||||
|
||||
Reference in New Issue
Block a user