fs

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDirectory = errors.New("Directory does not exist ")
)

Functions

func GetHomeDir

func GetHomeDir() (string, error)

GetHomeDir retrieves the home dir of current user

func GetModifiedTime

func GetModifiedTime(path string) (time.Time, error)

GetModifiedTime returns the modified time for the given path

func GetNameAndExtension

func GetNameAndExtension(filename string) (string, string)

GetNameAndExtension retrieves the name and extension of a given file

func HasFileBeenModified

func HasFileBeenModified(inFile string, recentThresholdInDays time.Duration) bool

HasFileBeenModified returns true if the file mtime is within recentThresholdInDays. false, otherwise.

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory checks if file is directory or otherwise

func IsExist

func IsExist(inFile string) bool

IsExist checks if file exists or otherwise

func IsNotExist

func IsNotExist(inFile string) bool

IsNotExist checks if inFile does not exist or otherwise

func NewStore

func NewStore(config *Config) (unistore.Store, error)

func ReadLineByLine

func ReadLineByLine(inFile string, fnProcessLine func(line string, linenumber int) error) error

ReadLineByLine reads from a given file, line by line

func SaveContent

func SaveContent(outputFile string, content []byte) error

SaveContent saves the content to a given file

Types

type Config

type Config struct {
	DataDir string
}

type Store

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

func (*Store) Delete

func (store *Store) Delete(inPath string) error

func (*Store) DoesPathExist

func (store *Store) DoesPathExist(inPath string) bool

func (*Store) GetData

func (store *Store) GetData(inPath string) ([]byte, error)

GetData retrieves the data present in the abstract path

func (*Store) GetModifiedTime

func (store *Store) GetModifiedTime(inPath string) (time.Time, error)

func (*Store) ListItems

func (store *Store) ListItems(basePath *string, filter filter.Filter) ([]string, error)

func (*Store) PutData

func (store *Store) PutData(path string, data []byte) error

func (*Store) Validate

func (store *Store) Validate() error

Jump to

Keyboard shortcuts

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