storageos

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package storageos implements an os-backed storage Bucket.

Index

Constants

View Source
const BucketType = "os"

BucketType = the bucket type.

Variables

This section is empty.

Functions

func IsNotDir

func IsNotDir(err error) bool

IsNotDir returns true for a Error that is for a root path not being a directory.

This is only returned when creating a Bucket, or when putting a file into a directory path - paths within buckets are all regular files.

func NewBucket

func NewBucket(rootPath string) (storage.Bucket, error)

NewBucket returns a new OS bucket.

Only regular files are handled, that is Exists should only be called for regular files, Get and Put only work for regular files, Put automatically calls Mkdir, and Walk only calls f on regular files.

Not thread-safe.

func NewReadBucket

func NewReadBucket(rootPath string) (storage.ReadBucket, error)

NewReadBucket returns a new read-only OS bucket.

It is better to use this if you want to make sure your callers are not writing to the filesystem.

Only regular files are handled, that is Exists should only be called for regular files, Get and Put only work for regular files, Put automatically calls Mkdir, and Walk only calls f on regular files.

Not thread-safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

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