filesystem

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2020 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSStorage

type FSStorage struct {
	// contains filtered or unexported fields
}

FSStorage holds filesystem configuration

func NewStorager

func NewStorager(storageFilesystemConfig *app.ConfigStorageFilesystem) (*FSStorage, error)

NewStorager returs new instance if FilesystemStorage or error when soething goes wrong

func (*FSStorage) DirectoryLayout

func (fs *FSStorage) DirectoryLayout(path string) ([]string, error)

DirectoryLayout returns model's directory structure

func (*FSStorage) GetFileContent

func (fs *FSStorage) GetFileContent(ctx context.Context, source string) ([]byte, error)

GetFileContent returns bytes stream of file located under given source filepath

func (*FSStorage) ReadAllModels

func (fs *FSStorage) ReadAllModels(ctx context.Context, modelID app.ServableID) ([]storage.ArchiveHeader, error)

func (*FSStorage) ReadConfig

func (fs *FSStorage) ReadConfig(ctx context.Context, team, project string) ([]byte, error)

func (*FSStorage) ReadModel

func (fs *FSStorage) ReadModel(ctx context.Context, modelID app.ServableID, version int) ([]storage.ArchiveHeader, error)

func (*FSStorage) ReadModule

func (fs *FSStorage) ReadModule(ctx context.Context, moduleID app.ServableID, version int) ([]storage.ArchiveHeader, error)

func (*FSStorage) RemoveModel

func (fs *FSStorage) RemoveModel(ctx context.Context, id app.ServableID, version int) error

func (*FSStorage) RemoveModule

func (fs *FSStorage) RemoveModule(ctx context.Context, id app.ServableID, version int64) error

func (*FSStorage) SaveArchiveFile

func (fs *FSStorage) SaveArchiveFile(ctx context.Context, header *tar.Header, archive *tar.Reader, archivePath string) error

SaveArchiveFile saves an archive under given archivePath location

func (*FSStorage) SaveConfig

func (fs *FSStorage) SaveConfig(ctx context.Context, team, project string, config []byte) error

func (*FSStorage) SaveIncomingModelArchive

func (fs *FSStorage) SaveIncomingModelArchive(modelID app.ServableID, archive io.Reader) (string, error)

func (*FSStorage) SaveIncomingModuleArchive

func (fs *FSStorage) SaveIncomingModuleArchive(moduleID app.ServableID, archive io.Reader) (string, error)

func (*FSStorage) SaveModel

func (fs *FSStorage) SaveModel(ctx context.Context, archivePath string, modelID app.ServableID, version int) error

func (*FSStorage) SaveModule

func (fs *FSStorage) SaveModule(ctx context.Context, archivePath string, moduleID app.ServableID, version int) error

type ModelFilesystemConfig

type ModelFilesystemConfig struct {
	ArchiveName         string
	BasePath            string
	ConfigName          string
	EmptyConfigName     string
	IncomingArchivePath string

	DirPerm  os.FileMode
	FilePerm os.FileMode
}

ModelFilesystemConfig holds configuration necessary for valid work of filesystem

type ModuleFilesystemConfig

type ModuleFilesystemConfig struct {
	ArchiveName         string
	BasePath            string
	IncomingArchivePath string

	DirPerm  os.FileMode
	FilePerm os.FileMode
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL