Documentation ¶
Index ¶
- type FileStore
- type Module
- func (m *Module) CloseConfig() error
- func (m *Module) CreateDir(ctx context.Context, project, token string, req *model.CreateFileRequest, ...) (int, error)
- func (m *Module) DeleteDir(ctx context.Context, project, token string, path string, ...) (int, error)
- func (m *Module) DeleteFile(ctx context.Context, project, token string, path string, ...) (int, error)
- func (m *Module) DoesExists(ctx context.Context, project, token, path string) error
- func (m *Module) DownloadFile(ctx context.Context, project, token, path string) (int, *model.File, error)
- func (m *Module) GetState(ctx context.Context) 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(project string, conf *config.FileStoreConfig) error
- func (m *Module) SetEventingModule(eventing model.EventingModule)
- func (m *Module) SetGetSecrets(function utils.GetSecrets)
- 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, req *model.CreateFileRequest, file io.Reader) error CreateDir(ctx context.Context, req *model.CreateFileRequest) error ListDir(ctx context.Context, req *model.ListFilesRequest) ([]*model.ListFilesResponse, error) ReadFile(ctx context.Context, path string) (*model.File, error) DeleteDir(ctx context.Context, path string) error DeleteFile(ctx context.Context, path string) error DoesExists(ctx context.Context, path string) error GetState(ctx context.Context) 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 Init ¶
func Init(auth model.AuthFilestoreInterface, hook model.MetricFileHook) *Module
Init creates a new instance of the file store object
func (*Module) CreateDir ¶
func (m *Module) CreateDir(ctx context.Context, project, token string, req *model.CreateFileRequest, meta map[string]interface{}) (int, error)
CreateDir creates a directory at the provided path
func (*Module) DeleteDir ¶
func (m *Module) DeleteDir(ctx context.Context, project, token string, path string, meta map[string]interface{}) (int, error)
DeleteDir deletes a directory at the provided path
func (*Module) DeleteFile ¶
func (m *Module) DeleteFile(ctx context.Context, project, token string, path string, meta map[string]interface{}) (int, error)
DeleteFile deletes a file at the provided path
func (*Module) DoesExists ¶
DoesExists checks if the provided path exists
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
func (*Module) SetConfig ¶
func (m *Module) SetConfig(project string, conf *config.FileStoreConfig) error
SetConfig set the rules and secret key required by the filestore block
func (*Module) SetEventingModule ¶
func (m *Module) SetEventingModule(eventing model.EventingModule)
SetEventingModule sets the eventing module
func (*Module) SetGetSecrets ¶
func (m *Module) SetGetSecrets(function utils.GetSecrets)
SetGetSecrets sets the GetSecrets function