storage

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Key   string `json:"key"`
	Value string `json:"value"`

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type BlobStorage

type BlobStorage interface {
	Get(key string) (Blob, bool, error)
	Put(key, value string) error
}

func NewHeapBlobStorage

func NewHeapBlobStorage() BlobStorage

type HeapBlobStorage

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

func (*HeapBlobStorage) Get

func (bs *HeapBlobStorage) Get(key string) (Blob, bool, error)

func (*HeapBlobStorage) Put

func (bs *HeapBlobStorage) Put(key, value string) error

type HeapJournal

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

func (HeapJournal) Write

func (j HeapJournal) Write(key, content string) error

type Journal

type Journal interface {
	Write(key, content string) error
}

func NewHeapJournal

func NewHeapJournal() Journal

type JournalEntry

type JournalEntry struct {
	Id uuid.UUID `json:"id"`

	Key     string `json:"key"`
	Content string `json:"content"`

	CreatedAt time.Time `json:"created_at"`
}

type NopBlobStorage

type NopBlobStorage struct{}

func (NopBlobStorage) Get

func (n NopBlobStorage) Get(key string) (Blob, bool, error)

func (NopBlobStorage) Put

func (n NopBlobStorage) Put(key, value string) error

type NopJournal

type NopJournal struct{}

func (NopJournal) Write

func (j NopJournal) Write(key, content string) error

Jump to

Keyboard shortcuts

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