local

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

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

Local is the file store driver for the local filesystem

func Init

func Init(path string) (*Local, error)

Init initialises the local filestore driver

func (*Local) Close

func (l *Local) Close() error

Close gracefully closed the local filestore module

func (*Local) CreateDir

func (l *Local) CreateDir(ctx context.Context, req *model.CreateFileRequest) error

CreateDir creates a directory in the path provided

func (*Local) CreateFile

func (l *Local) CreateFile(ctx context.Context, req *model.CreateFileRequest, file io.Reader) error

CreateFile creates a file in the path provided

func (*Local) DeleteDir

func (l *Local) DeleteDir(ctx context.Context, path string) error

DeleteDir deletes a directory if it exists

func (*Local) DeleteFile

func (l *Local) DeleteFile(ctx context.Context, path string) error

DeleteFile deletes a file if it exists

func (*Local) DoesExists

func (l *Local) DoesExists(ctx context.Context, path string) error

DoesExists checks if the path exists

func (*Local) GetState

func (l *Local) GetState(ctx context.Context) error

GetState check if root path is valid

func (*Local) GetStoreType

func (l *Local) GetStoreType() utils.FileStoreType

GetStoreType returns the file store type

func (*Local) ListDir

ListDir lists the directory

func (*Local) ReadFile

func (l *Local) ReadFile(ctx context.Context, path string) (*model.File, error)

ReadFile reads a file from the path provided

Jump to

Keyboard shortcuts

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