Added endpoint to list files.

This commit is contained in:
Andrey Melnikov
2020-02-27 14:44:50 -08:00
parent cc49bac23b
commit e65fe291c2
7 changed files with 637 additions and 86 deletions

View File

@@ -1,6 +1,7 @@
package v1
import (
"strings"
"time"
wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
@@ -103,3 +104,25 @@ type WorkflowExecutionOptions struct {
ListOptions *ListOptions
PodGCStrategy *PodGCStrategy
}
type File struct {
Path string
Name string
Size int64
ContentType string
LastModified time.Time
Directory bool
}
func FilePathToName(path string) string {
if strings.HasSuffix(path, "/") {
path = path[:len(path)-1]
}
lastSlashIndex := strings.LastIndex(path, "/")
if lastSlashIndex < 0 {
return path
}
return path[lastSlashIndex+1:]
}