storage

package
v0.0.0-...-522a375 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExisting = errors.New("path does not exist")
View Source
var NewLine = fmt.Sprintln()

Functions

func CreateFileWithText

func CreateFileWithText(path, text string, opener FileCreateOpener) error

func ReadModuleName

func ReadModuleName(path string, opener FileReadOpener) (string, error)

Types

type DirEntry

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

func (DirEntry) IsDir

func (e DirEntry) IsDir() bool

func (DirEntry) Name

func (e DirEntry) Name() string

type DirReader

type DirReader struct{}

func (DirReader) Read

func (r DirReader) Read(path string) ([]models.DirEntry, error)

type FileCreateOpener

type FileCreateOpener interface {
	OpenCreate(path string) (io.WriteCloser, error)
}

type FileOpener

type FileOpener struct{}

func (FileOpener) OpenCreate

func (o FileOpener) OpenCreate(path string) (io.WriteCloser, error)

func (FileOpener) OpenRead

func (o FileOpener) OpenRead(path string) (io.ReadCloser, error)

type FileReadOpener

type FileReadOpener interface {
	OpenRead(path string) (io.ReadCloser, error)
}

type Store

type Store struct {
	FileOpener
	DirReader
}

func (Store) TryAccessing

func (s Store) TryAccessing(path string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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