bindings

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: Apache-2.0 Imports: 3 Imported by: 25

Documentation

Index

Constants

View Source
const (
	ANY    = 0
	EQ     = 1
	LT     = 2
	LE     = 3
	GT     = 4
	GE     = 5
	RANGE  = 6
	SET    = 7
	ALLSET = 8
	EMPTY  = 9

	ERROR   = 1
	WARNING = 2
	INFO    = 3
	TRACE   = 4

	AggSum = 0
	AggAvg = 1

	CollateNone    = 0
	CollateASCII   = 1
	CollateUTF8    = 2
	CollateNumeric = 3
	CollateCustom  = 4
)

public go consts from type_consts.h and reindexer_ctypes.h

View Source
const (
	OpOr  = 1
	OpAnd = 2
	OpNot = 3

	ValueInt       = 0
	ValueInt64     = 1
	ValueString    = 2
	ValueDouble    = 3
	ValueComposite = 6

	QueryCondition      = 0
	QueryDistinct       = 1
	QuerySortIndex      = 2
	QueryJoinOn         = 3
	QueryLimit          = 4
	QueryOffset         = 5
	QueryReqTotal       = 6
	QueryDebugLevel     = 7
	QueryAggregation    = 8
	QuerySelectFilter   = 9
	QuerySelectFunction = 10
	QueryEnd            = 11

	LeftJoin    = 0
	InnerJoin   = 1
	OrInnerJoin = 2
	Merge       = 3

	CacheModeOn         = 0
	CacheModeAggressive = 1
	CacheModeOff        = 2

	FormatJson  = 0
	FormatCJson = 1

	ModeUpdate = 0
	ModeInsert = 1
	ModeUpsert = 2
	ModeDelete = 3

	ModeNoCalc        = 0
	ModeCachedTotal   = 1
	ModeAccurateTotal = 2

	ResultsPure             = 0
	ResultsWithPtrs         = 1
	ResultsWithCJson        = 2
	ResultsWithJson         = 3
	ResultsWithPayloadTypes = 8

	IndexOptPK         = 1 << 7
	IndexOptArray      = 1 << 6
	IndexOptDense      = 1 << 5
	IndexOptAppendable = 1 << 4
	IndexOptSparse     = 1 << 3

	StorageOptEnabled               = 1
	StorageOptDropOnFileFormatError = 1 << 1
	StorageOptCreateIfMissing       = 1 << 2

	ErrOK        = 0
	ErrParseSQL  = 1
	ErrQueryExec = 2
	ErrParams    = 3
	ErrLogic     = 4
	ErrParseJson = 5
	ErrParseDSL  = 6
	ErrConflict  = 7
)

private go consts from type_consts.h and reindexer_ctypes.h

View Source
const CInt32Max = int(^uint32(0) >> 1)

Variables

This section is empty.

Functions

func NewError

func NewError(text string, code int) error

func RegisterBinding

func RegisterBinding(name string, binding RawBinding)

Types

type CacheMode added in v1.9.2

type CacheMode uint8

type Error

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

func (Error) Code

func (e Error) Code() int

func (Error) Error

func (e Error) Error() string

type FetchMore added in v1.5.0

type FetchMore interface {
	Fetch(offset, limit int, withItems bool) (err error)
}

FetchMore interface for partial loading results (used in cproto)

type IndexOptions

type IndexOptions uint8

func (*IndexOptions) Appendable

func (indexOpts *IndexOptions) Appendable(value bool) *IndexOptions

func (*IndexOptions) Array

func (indexOpts *IndexOptions) Array(value bool) *IndexOptions

func (*IndexOptions) Dense

func (indexOpts *IndexOptions) Dense(value bool) *IndexOptions

func (*IndexOptions) IsAppendable

func (indexOpts *IndexOptions) IsAppendable() bool

func (*IndexOptions) IsArray

func (indexOpts *IndexOptions) IsArray() bool

func (*IndexOptions) IsDense

func (indexOpts *IndexOptions) IsDense() bool

func (*IndexOptions) IsPK

func (indexOpts *IndexOptions) IsPK() bool

func (*IndexOptions) IsSparse added in v1.9.5

func (indexOpts *IndexOptions) IsSparse() bool

func (*IndexOptions) PK

func (indexOpts *IndexOptions) PK(value bool) *IndexOptions

func (*IndexOptions) Sparse added in v1.9.5

func (indexOpts *IndexOptions) Sparse(value bool) *IndexOptions

type Logger

type Logger interface {
	Printf(level int, fmt string, msg ...interface{})
}

Logger interface for reindexer

type OptionBuiltinWithServer added in v1.9.6

type OptionBuiltinWithServer struct {
	StartupTimeout time.Duration
	ServerConfig   *config.ServerConfig
}

type OptionCgoLimit added in v1.9.3

type OptionCgoLimit struct {
	CgoLimit int
}

type OptionConnPoolSize added in v1.9.3

type OptionConnPoolSize struct {
	ConnPoolSize int
}

type OptionRetryAttempts added in v1.9.5

type OptionRetryAttempts struct {
	Read  int
	Write int
}

type RawBinding

type RawBinding interface {
	Init(u *url.URL, options ...interface{}) error
	OpenNamespace(namespace string, enableStorage, dropOnFileFormatError bool, cacheMode uint8) error
	CloseNamespace(namespace string) error
	DropNamespace(namespace string) error
	EnableStorage(namespace string) error
	AddIndex(namespace, index, jsonPath, indexType, fieldType string, opts IndexOptions, collateMode int, sortOrderStr string) error
	DropIndex(namespace, index string) error
	ConfigureIndex(namespace, index, config string) error
	PutMeta(namespace, key, data string) error
	GetMeta(namespace, key string) (RawBuffer, error)
	ModifyItem(nsHash int, data []byte, mode int) (RawBuffer, error)
	Select(query string, withItems bool, ptVersions []int32, fetchCount int) (RawBuffer, error)
	SelectQuery(rawQuery []byte, withItems bool, ptVersions []int32, fetchCount int) (RawBuffer, error)
	DeleteQuery(nsHash int, rawQuery []byte) (RawBuffer, error)
	Commit(namespace string) error
	EnableLogger(logger Logger)
	DisableLogger()
	Ping() error
}

Raw binding to reindexer

func GetBinding

func GetBinding(name string) RawBinding

type RawBindingChanging added in v1.9.5

type RawBindingChanging interface {
	OnChangeCallback(f func())
}

type RawBuffer

type RawBuffer interface {
	GetBuf() []byte
	Free()
}

go interface to reindexer_c.h interface

type Stats

type Stats struct {
	CountGetItem int
	TimeGetItem  time.Duration
	CountSelect  int
	TimeSelect   time.Duration
	CountInsert  int
	TimeInsert   time.Duration
	CountUpdate  int
	TimeUpdate   time.Duration
	CountUpsert  int
	TimeUpsert   time.Duration
	CountDelete  int
	TimeDelete   time.Duration
	CountJoin    int
	TimeJoin     time.Duration
}

type StorageOptions

type StorageOptions uint8

func (*StorageOptions) DropOnFileFormatError

func (so *StorageOptions) DropOnFileFormatError(value bool) *StorageOptions

func (*StorageOptions) Enabled

func (so *StorageOptions) Enabled(value bool) *StorageOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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