stringfs

package
v0.0.0-...-f3d8a94 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

The stringfs package provides a way to recursively encode the data in a directory as a string, and to extract the contents later.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(path string) (string, error)

Encode recursively reads the directory at path and encodes it into a read only file system that can later be read with Decode.

Types

type FS

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

FS represents the file system and all its data.

func Decode

func Decode(s string) (*FS, error)

Decode converts a file system as encoded by Encode into an FS.

func (*FS) Open

func (fs *FS) Open(path string) (*File, error)

Open opens the named path within fs. Paths are slash-separated, with an optional slash prefix.

type File

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

A File represents an entry in the file system.

func (*File) IsDirectory

func (f *File) IsDirectory() bool

IsDirectory returns true if the file represents a directory.

func (*File) Read

func (f *File) Read(buf []byte) (int, error)

Read reads from a file. It is invalid to call it on a directory.

func (*File) Readdirnames

func (f *File) Readdirnames() ([]string, error)

Readdirnames returns the names of all the files in the File, which must be a directory.

Jump to

Keyboard shortcuts

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