bfsfs

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package bfsfs abstracts local file system.

When imported, it registers a global `file://` scheme resolver and can be used like:

import (
  "github.com/bsm/bfs"

  _ "github.com/bsm/bfs/bfsfs"
)

func main() {
  ctx := context.Background()

  u, _ := url.Parse("file:///path/to/root?tmpdir=%2Fcustom%2Ftmp")
  bucket, _ := bfs.Resolve(ctx, u)

  f, _ := bucket.Open(ctx, "file/within/root.txt")
  ...
}

bfs.Resolve supports the following query parameters:

tmpdir - custom temp dir

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(root, tmpDir string) (bfs.Bucket, error)

New initiates an bfs.Bucket backed by local file system. tmpDir is used for file atomicity, defaults to standard tmp dir if blank.

Types

This section is empty.

Jump to

Keyboard shortcuts

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