storage

package
v0.0.0-...-3c2c6e0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserHome

func GetUserHome() string

GetUserHome returns the home directory of the user

Types

type Storage

type Storage interface {
	//Update updates the file of the given filename in the storage with the given data
	Update(filename string, data []byte) error
	//Read reads the file of the given filename from the storage
	Read(filename string) ([]byte, error)
}

Storage interface definition of a storage for persisting files

func NewStorage

func NewStorage(storageDir string) (Storage, error)

NewStorage creates a new storage for file at the given directory

func NewStorageAtUserHome

func NewStorageAtUserHome() Storage

NewStorageAtUserHome creates a new storage for files at the user home directory

Jump to

Keyboard shortcuts

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