index

package
v0.0.0-...-ada256f Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package index is grouped around the Index component, representing an index which stores and retrieves document properties.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index interface {
	Index(ctx context.Context, id string, properties interface{}) error
	Update(ctx context.Context, id string, properties interface{}) error
	Get(ctx context.Context, id string, dst interface{}, fields ...string) (bool, error)
	Delete(ctx context.Context, id string) error
}

Index represents an index which stores and retrieves document properties.

func MultiGet

func MultiGet(ctx context.Context, indexes []Index, id string, dst interface{}, fields ...string) (Index, error)

MultiGet returns `fields` for the first document with `id` from given `indexes`. When the document is not found (nil, nil) is returned.

type Mock

type Mock struct {
	mock.Mock
}

Mock mocks the Index interface.

func (*Mock) Delete

func (m *Mock) Delete(ctx context.Context, id string) error

Delete mocks the Delete method on the Index interface.

func (*Mock) Get

func (m *Mock) Get(ctx context.Context, id string, dst interface{}, fields ...string) (bool, error)

Get mocks the Get method on the Index interface.

func (*Mock) Index

func (m *Mock) Index(ctx context.Context, id string, properties interface{}) error

Index mocks the Index method on the Index interface.

func (*Mock) Update

func (m *Mock) Update(ctx context.Context, id string, properties interface{}) error

Update mocks the Update method on the Index interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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