afero

package module
v0.0.0-...-a10e443 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

afero-lite

A lightweight FileSystem Abstraction System for Go

Modifications

This is afero, reorganized to avoid bloated binaries when a subset of features is used (aka when net/http is not needed). The following modifications are made:

  • "github.com/spf13/afero replaced with "github.com/tbhartman/afero/lite
  • all root go files are moved to a lite package, except for httpFs.go
  • new aliases are created at the root level to reference exported symbols in lite

Usage

Unless you need NewHttpFs, use the lite package, which is imported as afero.

package main

import "github.com/tbhartman/afero/lite"

func main() {
	var myfs afero.Fs
	myfs = afero.NewOsFs()
	myfs.Stat("myfile")
}

If you need httpFs functionality, import from root:

package main

import (
	"github.com/tbhartman/afero"
)

func main() {
	var myfs afero.Fs
	myfs = afero.NewHttpFs(afero.NewMemMapFs())
}

Versioning

Versioning will follow major and minor releases of afero, but the patch version will update independently as patches to this repo are required!

Documentation

Overview

Code generated with liteGen.go DO NOT EDIT.

Index

Constants

View Source
const BADFD = lite.BADFD

aliasing constants from lite package

View Source
const FilePathSeparator = lite.FilePathSeparator

Variables

View Source
var DirExists = lite.DirExists

aliasing functions from lite package

View Source
var ErrFileClosed = lite.ErrFileClosed

aliasing variables from lite package

View Source
var ErrNoReadlink = lite.ErrNoReadlink
View Source
var ErrNoSymlink = lite.ErrNoSymlink
View Source
var ErrOutOfRange = errors.New("out of range")

manually alias ErrOutOfRange

View Source
var Exists = lite.Exists
View Source
var FileContainsAnyBytes = lite.FileContainsAnyBytes
View Source
var FileContainsBytes = lite.FileContainsBytes
View Source
var FullBaseFsPath = lite.FullBaseFsPath
View Source
var GetTempDir = lite.GetTempDir
View Source
var Glob = lite.Glob
View Source
var IsDir = lite.IsDir
View Source
var IsEmpty = lite.IsEmpty
View Source
var NeuterAccents = lite.NeuterAccents
View Source
var NewBasePathFs = lite.NewBasePathFs
View Source
var NewCacheOnReadFs = lite.NewCacheOnReadFs
View Source
var NewCopyOnWriteFs = lite.NewCopyOnWriteFs
View Source
var NewIOFS = lite.NewIOFS
View Source
var NewMemMapFs = lite.NewMemMapFs
View Source
var NewOsFs = lite.NewOsFs
View Source
var NewReadOnlyFs = lite.NewReadOnlyFs
View Source
var NewRegexpFs = lite.NewRegexpFs
View Source
var ReadAll = lite.ReadAll
View Source
var ReadDir = lite.ReadDir
View Source
var ReadFile = lite.ReadFile
View Source
var SafeWriteReader = lite.SafeWriteReader
View Source
var TempDir = lite.TempDir
View Source
var TempFile = lite.TempFile
View Source
var UnicodeSanitize = lite.UnicodeSanitize
View Source
var Walk = lite.Walk
View Source
var WriteFile = lite.WriteFile
View Source
var WriteReader = lite.WriteReader

Functions

This section is empty.

Types

type Afero

type Afero = lite.Afero

aliasing types from lite package

type BasePathFile

type BasePathFile = lite.BasePathFile

type BasePathFs

type BasePathFs = lite.BasePathFs

type CacheOnReadFs

type CacheOnReadFs = lite.CacheOnReadFs

type CopyOnWriteFs

type CopyOnWriteFs = lite.CopyOnWriteFs

type DirsMerger

type DirsMerger = lite.DirsMerger

type File

type File = lite.File

type FromIOFS

type FromIOFS = lite.FromIOFS

type Fs

type Fs = lite.Fs

type HttpFs

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

func NewHttpFs

func NewHttpFs(source Fs) *HttpFs

func (HttpFs) Chmod

func (h HttpFs) Chmod(name string, mode os.FileMode) error

func (HttpFs) Chown

func (h HttpFs) Chown(name string, uid, gid int) error

func (HttpFs) Chtimes

func (h HttpFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (HttpFs) Create

func (h HttpFs) Create(name string) (File, error)

func (HttpFs) Dir

func (h HttpFs) Dir(s string) *httpDir

func (HttpFs) Mkdir

func (h HttpFs) Mkdir(name string, perm os.FileMode) error

func (HttpFs) MkdirAll

func (h HttpFs) MkdirAll(path string, perm os.FileMode) error

func (HttpFs) Name

func (h HttpFs) Name() string

func (HttpFs) Open

func (h HttpFs) Open(name string) (http.File, error)

func (HttpFs) OpenFile

func (h HttpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error)

func (HttpFs) Remove

func (h HttpFs) Remove(name string) error

func (HttpFs) RemoveAll

func (h HttpFs) RemoveAll(path string) error

func (HttpFs) Rename

func (h HttpFs) Rename(oldname, newname string) error

func (HttpFs) Stat

func (h HttpFs) Stat(name string) (os.FileInfo, error)

type IOFS

type IOFS = lite.IOFS

type LinkReader

type LinkReader = lite.LinkReader

type Linker

type Linker = lite.Linker

type Lstater

type Lstater = lite.Lstater

type MemMapFs

type MemMapFs = lite.MemMapFs

type OsFs

type OsFs = lite.OsFs

type ReadOnlyFs

type ReadOnlyFs = lite.ReadOnlyFs

type RegexpFile

type RegexpFile = lite.RegexpFile

type RegexpFs

type RegexpFs = lite.RegexpFs

type Symlinker

type Symlinker = lite.Symlinker

type UnionFile

type UnionFile = lite.UnionFile

Directories

Path Synopsis
internal
package tarfs implements a read-only in-memory representation of a tar archive
package tarfs implements a read-only in-memory representation of a tar archive

Jump to

Keyboard shortcuts

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