entry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoReaderFactoryProvided     = errors.New("no entry.ReaderFactory provided")
	ErrNoToFileTransformerProvided = errors.New("no entry.ToFileTransformer provided")
)

Functions

func CleanPath

func CleanPath(in string) string

Types

type Entries

type Entries map[string]Entry

func (*Entries) Add

func (instance *Entries) Add(pathname string, entry Entry) error

func (Entries) Filter

func (instance Entries) Filter(predicate Predicate) (Entries, error)

func (*Entries) Find

func (instance *Entries) Find(pathname string) *Entry

func (*Entries) Get

func (instance *Entries) Get(pathname string) (Entry, error)

func (*Entries) Replace

func (instance *Entries) Replace(pathname string, entry Entry) error

type Entry

type Entry struct {
	BaseName string            // 0
	Offset   common.FileOffset // 1
	Length   int64             // 2
	FileMode os.FileMode       // 3
	Time     time.Time         // 4
	Checksum Sha256Checksum    // 5
	Meta     Meta              // 6
	// contains filtered or unexported fields
}

noinspection GoStructTag

func (Entry) ChecksumString

func (instance Entry) ChecksumString() string

func (Entry) IsDir

func (instance Entry) IsDir() bool

func (Entry) ModTime

func (instance Entry) ModTime() time.Time

func (Entry) Mode

func (instance Entry) Mode() os.FileMode

func (Entry) Name

func (instance Entry) Name() string

func (Entry) Size

func (instance Entry) Size() int64

func (Entry) String

func (instance Entry) String() string

func (Entry) Sys

func (instance Entry) Sys() interface{}

type File

type File struct {
	Entry         Entry
	Path          string
	ReaderFactory ReaderFactory
	// contains filtered or unexported fields
}

func (*File) Close

func (instance *File) Close() error

func (*File) Read

func (instance *File) Read(p []byte) (n int, err error)

func (*File) Readdir

func (instance *File) Readdir(count int) ([]os.FileInfo, error)

func (*File) Seek

func (instance *File) Seek(offset int64, whence int) (int64, error)

func (*File) Stat

func (instance *File) Stat() (os.FileInfo, error)

func (File) String

func (instance File) String() string

type Meta

type Meta map[string]interface{}

type Predicate

type Predicate func(path string, entry Entry) (bool, error)

type Reader

type Reader interface {
	io.Reader
	io.Seeker
}

type ReaderFactory

type ReaderFactory func(entry Entry) (Reader, error)

type Sha256Checksum

type Sha256Checksum [sha256.Size]byte

Jump to

Keyboard shortcuts

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