memory

package
v0.0.0-...-9b83d1d Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilTimeUpToMicroseconds

func CeilTimeUpToMicroseconds(timeToCeil time.Time) time.Time

This function is needed for being cross-platform

Types

type Folder

type Folder struct {
	Storage *Storage
	// contains filtered or unexported fields
}

func NewFolder

func NewFolder(path string, storage *Storage) *Folder

func (*Folder) DeleteObjects

func (folder *Folder) DeleteObjects(objectRelativePaths []string) error

func (*Folder) Exists

func (folder *Folder) Exists(objectRelativePath string) (bool, error)

func (*Folder) GetPath

func (folder *Folder) GetPath() string

func (*Folder) GetSubFolder

func (folder *Folder) GetSubFolder(subFolderRelativePath string) storage.Folder

func (*Folder) ListFolder

func (folder *Folder) ListFolder() (objects []storage.Object, subFolders []storage.Folder, err error)

func (*Folder) PutObject

func (folder *Folder) PutObject(name string, content io.Reader) error

func (*Folder) ReadObject

func (folder *Folder) ReadObject(objectRelativePath string) (io.ReadCloser, error)

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage is supposed to be used for tests. It doesn't guarantee data safety!

func NewStorage

func NewStorage() *Storage

func (*Storage) Delete

func (storage *Storage) Delete(key string)

func (*Storage) Load

func (storage *Storage) Load(key string) (value TimeStampedData, exists bool)

func (*Storage) Range

func (storage *Storage) Range(callback func(key string, value TimeStampedData) bool)

func (*Storage) Store

func (storage *Storage) Store(key string, value bytes.Buffer)

type TimeStampedData

type TimeStampedData struct {
	Data      bytes.Buffer
	Timestamp time.Time
}

func TimeStampData

func TimeStampData(data bytes.Buffer) TimeStampedData

Jump to

Keyboard shortcuts

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