namespace

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRecordAlreadyExists added in v0.1.0

func NewRecordAlreadyExists(id int64) error

Types

type Logger added in v0.1.0

type Logger interface {
	Println(args ...any)
}

type Namespace

type Namespace[R record.Record] interface {
	Get(id int64) (R, bool)
	Insert(item R) error
	Delete(id int64) error
	Upsert(item R) error
	executor.Selector[R]
}

type RecordAlreadyExistsError added in v0.1.0

type RecordAlreadyExistsError struct {
	ID int64
}

func (RecordAlreadyExistsError) Error added in v0.1.0

func (e RecordAlreadyExistsError) Error() string

func (RecordAlreadyExistsError) Is added in v0.1.0

type WithIndexes added in v0.1.0

type WithIndexes[R record.Record] struct {
	// contains filtered or unexported fields
}

func CreateNamespace added in v0.1.0

func CreateNamespace[R record.Record]() *WithIndexes[R]

func (*WithIndexes[R]) AddIndex added in v0.1.0

func (ns *WithIndexes[R]) AddIndex(index indexes.Index[R])

func (*WithIndexes[R]) Delete added in v0.1.0

func (ns *WithIndexes[R]) Delete(id int64) error

func (*WithIndexes[R]) Get added in v0.1.0

func (ns *WithIndexes[R]) Get(id int64) (R, bool)

func (*WithIndexes[R]) Insert added in v0.1.0

func (ns *WithIndexes[R]) Insert(item R) error

func (*WithIndexes[R]) PreselectForExecutor added in v0.1.0

func (ns *WithIndexes[R]) PreselectForExecutor(conditions where.Conditions[R]) (
	[]R,
	error,
)

func (*WithIndexes[R]) SetLogger added in v0.1.0

func (ns *WithIndexes[R]) SetLogger(logger Logger)

func (*WithIndexes[R]) Upsert added in v0.1.0

func (ns *WithIndexes[R]) Upsert(item R) error

Jump to

Keyboard shortcuts

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