persist

package
v0.0.0-...-da8642b Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package persist contains persist-specific interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemSyncer

type ItemSyncer interface {
	Write(MarshallableItem) error
	Delete(MarshallableItem) error
	LoadAll() ([]MarshallableItem, error)
	LoadByID(string) (MarshallableItem, error)
}

ItemSyncer is a syncer of items from/to some kind of storage, such as a database.

type MarshallableItem

type MarshallableItem interface {
	Marshal() ([]byte, error)
	ID() (string, error)
}

MarshallableItem is an interface for representing items that can be marshalled (for persisting).

type Unmarshaller

type Unmarshaller interface {
	Unmarshal([]byte) (MarshallableItem, error)
}

Unmarshaller is an interface for unmarshalling persisted items.

Jump to

Keyboard shortcuts

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