tbhartman / afero

A *lightweight* FileSystem Abstraction System for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

A *lightweight* FileSystem Abstraction System for Go

License:Apache License 2.0


Languages

Language:Go 100.0%