local

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 11

Documentation

Overview

Package local provides an abstraction of a general filesystem. A Stow Container is a directory, and a Stow Item is a file.

Credentials

The only information required in accessing a filesystem via Stow is the path of a directory.

Usage

Aside from providing stow.Dial with the correct Kind ("local"), a stow.Config instance is needed. This instance requires an entry with a key of stow.ConfigKeyPath and a value of the path of the directory.

Location

There are local.location methods which allow the retrieval of one or more directories (Container or Containers). A stow.Item representation of a file can also be achieved (ItemByURL).

Additional methods provide capabilities to create and remove directories (CreateContainer, RemoveContainer).

Container

Of a directory, methods of local.container allow the retrieval of its name (ID or Name) as well as one or more files (Item or Items) that exist within.

Additional local.container methods allow the removal of a file (RemoveItem) and the creation of one (Put).

Item

Methods of local.Item allow the retrieval of quite detailed information. They are: - full path (ID) - base file name (Name) - size in bytes (Size) - file metadata (path, inode, directory, permission bits, etc) - last modified date (ETag for string, LastMod for time.Time) - content (Open)

Index

Constants

View Source
const (
	MetadataPath       = "path"
	MetadataIsDir      = "is_dir"
	MetadataDir        = "dir"
	MetadataName       = "name"
	MetadataMode       = "mode"
	MetadataModeD      = "mode_d"
	MetadataPerm       = "perm"
	MetadataINode      = "inode"
	MetadataSize       = "size"
	MetadataIsHardlink = "is_hardlink"
	MetadataIsSymlink  = "is_symlink"
	MetadataLink       = "link"
)

Metadata constants describe the metadata available for a local Item.

View Source
const (
	ConfigKeyPath = "path"
)

ConfigKeys are the supported configuration items for local storage.

View Source
const Kind = "local"

Kind is the kind of Location this package provides.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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