reindexer

package
v1.72.14 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EQ     = reindexer.EQ     // =
	GT     = reindexer.GT     // >
	LT     = reindexer.LT     // <
	GE     = reindexer.GE     // >= (GT|EQ)
	LE     = reindexer.LE     // <= (LT|EQ)
	SET    = reindexer.SET    // one of set in []
	ALLSET = reindexer.ALLSET // all of set in []
	RANGE  = reindexer.RANGE  // value in RANGE from,to
	ANY    = reindexer.ANY    // any value
	EMPTY  = reindexer.EMPTY  // empty value or len(value array) == 0
	LIKE   = reindexer.LIKE   // string like pattern
)

Variables

View Source
var (
	ErrPrimaryKey = errors.New("primary key error")
	ErrNoAffected = errors.New("no affected rows")
)

Functions

This section is empty.

Types

type Client

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

func Open

func Open(conf Config, log zerolog.Logger) (*Client, error)

Open reindexer database client

func (*Client) Close

func (r *Client) Close() error

func (*Client) Create

func (r *Client) Create(ns string, item interface{}) (err error)

Create new item

func (*Client) Delete

func (r *Client) Delete(ns string, item interface{}) error

Delete item

func (*Client) Deletes

func (r *Client) Deletes(ctx context.Context, q Query) (err error)

Deletes items by query

func (*Client) Exists

func (r *Client) Exists(ctx context.Context, q Query) (exist bool, err error)

Exists items by query

func (*Client) Get

func (r *Client) Get(ctx context.Context, q Query) (item interface{}, err error)

Get item by query

func (*Client) Migrate

func (r *Client) Migrate(namespaces map[string]interface{}, dropOnIndexesConflict bool) error

func (*Client) Query

func (r *Client) Query(ns string) Query

func (*Client) Update

func (r *Client) Update(ns string, item interface{}) (err error)

Update item

func (*Client) Updates

func (r *Client) Updates(ctx context.Context, q Query) error

Updates items by query

type Config

type Config struct {
	Addr     string `desc:"database address (ip:port)"`
	Name     string `desc:"database name"`
	Username string
	Password string
	Builtin  bool `desc:"enable builtin mode"`
	// contains filtered or unexported fields
}

func (*Config) ValidAndRepair

func (c *Config) ValidAndRepair() error

type Query

type Query = *reindexer.Query

Jump to

Keyboard shortcuts

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