Documentation ¶
Index ¶
- func CloseDB() error
- func CreateBucket(bucket string) error
- func DelBucketKey(bucket, key string) error
- func GetBucketValue(bucket, key string, value interface{}) error
- func GetBucketValues(bucket string, values interface{}) error
- func NewDB() (err error)
- func SetBucketValue(bucket, key string, value interface{}) error
- type Item
- type Items
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBucket ¶
CreateBucket creates a new bucket if the bucket already exists do nothing
func DelBucketKey ¶
DelBugetKey deletes a key/value pair in a bucket
func GetBucketValue ¶
GetBucketValue gets a key/value pair in a bucket if the key does not exist, the value is set to nil takes bucket and key as strings, a value as pointer to interface{} and returns error
func GetBucketValues ¶
GetBucketValues returns all values in a bucket
func NewDB ¶
func NewDB() (err error)
NewDB creates and opens a BoltDB database at the given path If the file does not exist then it will be created automatically
func SetBucketValue ¶
SetBucketValue sets a key/value pair in a bucket if the key already exists, the value is overwritten if the value is nil, the key is deleted
Types ¶
type Item ¶
type Item struct { Hash string Name string Path string Size int64 IsDir bool UID int GID int CanBeRead bool CanBeWrite bool Mode os.FileMode ModTime time.Time Children *Items }
func ItemFromOs ¶
ItemFromOs returns an Item from an os.FileInfo. Use errors.Is to check the error type and handle it.
func (*Item) IsReadable ¶
IsReadable returns true if the item can be read.
func (*Item) IsWritable ¶
IsWritable returns true if the item can be write.