entity

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

README

Entity

That agnostic implementation to wrap common operations with single entity

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAttributeNotFound = errors.New("attribute not found")
View Source
var ErrStoreNotSet = errors.New("entity store is not set")

ErrStoreNotSet reports a nil entity store dependency.

Functions

This section is empty.

Types

type BinOptions added in v1.1.0

type BinOptions struct {
	Name string
}

BinOptions is the core-owned input for reading one entity bin.

type BinResult added in v1.1.0

type BinResult struct {
	Found bool
	Value any
}

BinResult is the core-owned result for reading one entity bin.

type ExistsResult added in v1.1.0

type ExistsResult struct {
	Exists bool
}

ExistsResult is the core-owned result for an entity existence check.

type Operation

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

func NewOperation

func NewOperation(
	client aerospike.Namespace,
	setName string,
	pk interface{},
	sendKey bool,
	expiration uint32,
) *Operation

func (*Operation) Execute

func (h *Operation) Execute(operations []*as.Operation) error

func (*Operation) Exists

func (h *Operation) Exists() (bool, as.Error)

func (*Operation) Get

func (h *Operation) Get(bins ...string) (*as.Record, error)

func (*Operation) GetBin

func (h *Operation) GetBin(binName string) (interface{}, error)

func (*Operation) GetNamespace

func (h *Operation) GetNamespace() aerospike.Namespace

type Operations

type Operations interface {
	Execute([]*as.Operation) error
	GetNamespace() aerospike.Namespace //nolint:staticcheck // legacy entity operations keep the namespace shim
	Get(bins ...string) (*as.Record, error)
	GetBin(binName string) (interface{}, error)
	Exists() (bool, as.Error)
}

type RecordStore added in v1.1.0

type RecordStore interface {
	Put(ctx context.Context, bins map[string]any) (aero.Result, error)
	Get(ctx context.Context, bins ...string) (aero.RecordResult, error)
	GetBin(ctx context.Context, options BinOptions) (BinResult, error)
	Exists(ctx context.Context) (ExistsResult, error)
	Delete(ctx context.Context) (aero.Result, error)
}

RecordStore is the core-owned contract for common Aerospike entity helpers.

type Store added in v1.1.0

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

Store wraps record-level entity helpers behind core-owned Aerospike contracts.

func NewStore added in v1.1.0

func NewStore(namespace aero.NamespaceStore, key aero.Key) *Store

NewStore creates entity helpers from a core-owned namespace store and key.

func (*Store) Delete added in v1.1.0

func (s *Store) Delete(ctx context.Context) (aero.Result, error)

Delete deletes an entity through a core-owned namespace store.

func (*Store) Exists added in v1.1.0

func (s *Store) Exists(ctx context.Context) (ExistsResult, error)

Exists checks whether an entity exists through a core-owned namespace store.

func (*Store) Get added in v1.1.0

func (s *Store) Get(ctx context.Context, bins ...string) (aero.RecordResult, error)

Get reads an entity record through a core-owned namespace store.

func (*Store) GetBin added in v1.1.0

func (s *Store) GetBin(ctx context.Context, options BinOptions) (BinResult, error)

GetBin reads one entity bin through a core-owned namespace store.

func (*Store) Put added in v1.1.0

func (s *Store) Put(ctx context.Context, bins map[string]any) (aero.Result, error)

Put writes entity bins through a core-owned namespace store.

Directories

Path Synopsis
Package mock_entity is a generated GoMock package.
Package mock_entity is a generated GoMock package.

Jump to

Keyboard shortcuts

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