Documentation
¶
Index ¶
- type FileStore
- type Module
- func (m *Module) CreateDir(ctx context.Context, project, token string, req *model.CreateFileRequest) (int, error)
- func (m *Module) DeleteFile(ctx context.Context, project, token, path string) (int, error)
- func (m *Module) DownloadFile(ctx context.Context, project, token, path string) (int, *model.File, error)
- func (m *Module) IsEnabled() bool
- func (m *Module) ListFiles(ctx context.Context, project, token string, req *model.ListFilesRequest) (int, []*model.ListFilesResponse, error)
- func (m *Module) SetConfig(conf *config.FileStore) error
- func (m *Module) UploadFile(ctx context.Context, project, token string, req *model.CreateFileRequest, ...) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore interface { CreateFile(ctx context.Context, project string, req *model.CreateFileRequest, file io.Reader) error CreateDir(ctx context.Context, project string, req *model.CreateFileRequest) error ListDir(ctx context.Context, project string, req *model.ListFilesRequest) ([]*model.ListFilesResponse, error) ReadFile(ctx context.Context, project, path string) (*model.File, error) DeleteDir(ctx context.Context, project, path string) error DeleteFile(ctx context.Context, project, path string) error GetStoreType() utils.FileStoreType Close() error }
FileStore abstracts the implementation file storage operations
type Module ¶
Module is responsible for managing the file storage module
func (*Module) CreateDir ¶
func (m *Module) CreateDir(ctx context.Context, project, token string, req *model.CreateFileRequest) (int, error)
CreateDir creates a directory at the provided path
func (*Module) DeleteFile ¶
DeleteFile deletes a file at the provided path
func (*Module) DownloadFile ¶
func (m *Module) DownloadFile(ctx context.Context, project, token, path string) (int, *model.File, error)
DownloadFile downloads a file from the provided path
func (*Module) ListFiles ¶
func (m *Module) ListFiles(ctx context.Context, project, token string, req *model.ListFilesRequest) (int, []*model.ListFilesResponse, error)
ListFiles lists all the files in the provided path
Click to show internal directories.
Click to hide internal directories.