storage

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IEntityStorage

type IEntityStorage[T any, K Key] interface {
	GetEntity(K) (T, error)
	PutEntities([]T) error
	GetAll(func(T) bool) error
	DeleteUids([]K) error
	Clear() error
}

func NewInMemoryEntityStorage

func NewInMemoryEntityStorage[T interface{}, K Key](entityKey func(T) K) IEntityStorage[T, K]

type ILinkStorage

type ILinkStorage[T any, KS Key, KO Key] interface {
	PutLinks([]T) error
	DeleteLinks([]IUidLink[KS, KO]) error
	DeleteLinksForSubjects([]KS) error
	DeleteLinksForObjects([]KO) error
	GetLinksForSubjects([]KS, func(T) bool) error
	GetLinksForObjects([]KO, func(T) bool) error
	GetAll(func(T) bool) error
	GetLink(KS, KO) (T, error)
	Clear() error
}

func NewInMemoryLinkStorage

func NewInMemoryLinkStorage[T any, KS Key, KO Key](subjectKey func(T) KS, objectKey func(T) KO) ILinkStorage[T, KS, KO]

type IRecordStorage

type IRecordStorage[T any] interface {
	Load() (T, error)
	Store(T) error
	Delete() error
}

func NewInMemoryRecordStorage

func NewInMemoryRecordStorage[T any]() IRecordStorage[T]

type IUid

type IUid[K Key] interface {
	Uid() K
}
type IUidLink[KS Key, KO Key] interface {
	SubjectUid() KS
	ObjectUid() KO
}
func NewUidLink[KS Key, KO Key](subjectUid KS, objectUid KO) IUidLink[KS, KO]

type Key

type Key interface {
	string | int64
}

Jump to

Keyboard shortcuts

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