forked from graymeta/stow
/
doc.go
34 lines (22 loc) · 1.3 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
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)
*/
package local