nosql

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const MaxRetries = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentBase

type DocumentBase struct {
	Key key.Key

	DocumentStore diface.ICollection
	// contains filtered or unexported fields
}

func (*DocumentBase) Clear

func (d *DocumentBase) Clear()

Clear clears all data on this DocumentBase.

func (*DocumentBase) Create

func (d *DocumentBase) Create() error

Create creates this DocumentBase if it doesn't already exist.

func (*DocumentBase) Init

func (d *DocumentBase) Init(
	data any,
	clear func(),
	store diface.ICollection,
	key key.Key,
)

Init performs an in-place initialization of a DocumentBase.

func (*DocumentBase) InitWithCache

func (d *DocumentBase) InitWithCache(
	data any,
	clear func(),
	store diface.ICollection,
	key key.Key,
	cache diface.ICache,
)

func (*DocumentBase) InitWithVersion

func (d *DocumentBase) InitWithVersion(
	data any,
	clear func(),
	store diface.ICollection,
	key key.Key,
	version noptions.Version,
)

func (*DocumentBase) Load

func (d *DocumentBase) Load() error

Load loads this DocumentBase from its store if it exists.

func (*DocumentBase) Save

func (d *DocumentBase) Save() error

Save saves this DocumentBase to the database if it's based on the latest version that Couchbase knows about.

func (*DocumentBase) Update

func (d *DocumentBase) Update(f func() bool) error

type VersionCache added in v1.0.1

type VersionCache struct {
	Version any
	Data    any
}

VersionCache is a cache of a version and its data structure.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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