Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRelativePath = errors.New("path cant be relative") ErrNonCanonicalPath = errors.New("path must be canonical") ErrPathTooLong = errors.New("path is too long") ErrPathInvalid = errors.New("path is invalid") ErrPathEndsWithDelimiter = errors.New("path can not end with delimiter") Delimiter = "/" DirectoryMimeType = "directory" )
Functions ¶
Types ¶
type File ¶
type File struct { Contents []byte FileMetadata }
type FileMetadata ¶
type FileStorage ¶
type FileStorage interface { Get(ctx context.Context, path string) (*File, error) Delete(ctx context.Context, path string) error Upsert(ctx context.Context, command *UpsertFileCommand) error // List lists only files without content by default List(ctx context.Context, folderPath string, paging *Paging, options *ListOptions) (*ListResponse, error) CreateFolder(ctx context.Context, path string) error DeleteFolder(ctx context.Context, path string) error // contains filtered or unexported methods }
func NewCdkBlobStorage ¶
func NewCdkBlobStorage(log log.Logger, bucket *blob.Bucket, rootFolder string, pathFilters *PathFilters) FileStorage
func NewDbStorage ¶
func NewDbStorage(log log.Logger, db *sqlstore.SQLStore, pathFilters *PathFilters, rootFolder string) FileStorage
type ListOptions ¶
type ListOptions struct { Recursive bool WithFiles bool WithFolders bool WithContents bool *PathFilters }
type ListResponse ¶
type PathFilters ¶
type PathFilters struct {
// contains filtered or unexported fields
}
func NewPathFilters ¶
func NewPathFilters(allowedPrefixes []string, allowedPaths []string, disallowedPrefixes []string, disallowedPaths []string) *PathFilters
func (*PathFilters) IsAllowed ¶
func (f *PathFilters) IsAllowed(path string) bool
Click to show internal directories.
Click to hide internal directories.