Documentation ¶
Index ¶
- Constants
- func NewError(text string, code int) error
- func RegisterBinding(name string, binding RawBinding)
- type Completion
- type ConnectOptions
- type Error
- type FetchMore
- type IndexDef
- type Logger
- type NamespaceDef
- type OptionBuiltinWithServer
- type OptionBuiltintCtxWatch
- type OptionCgoLimit
- type OptionConnPoolSize
- type OptionConnect
- type OptionReindexerInstance
- type OptionRetryAttempts
- type OptionTimeouts
- type RawBinding
- type RawBindingChanging
- type RawBuffer
- type RawCompletion
- type Stats
- type Status
- type StatusBuiltin
- type StatusCProto
- type StorageOptions
- type StorageOpts
- type TxCtx
Constants ¶
const ( ANY = 0 EQ = 1 LT = 2 LE = 3 GT = 4 GE = 5 RANGE = 6 SET = 7 ALLSET = 8 EMPTY = 9 LIKE = 10 ERROR = 1 WARNING = 2 INFO = 3 TRACE = 4 AggSum = 0 AggAvg = 1 AggFacet = 2 AggMin = 3 AggMax = 4 AggDistinct = 5 CollateNone = 0 CollateASCII = 1 CollateUTF8 = 2 CollateNumeric = 3 CollateCustom = 4 )
public go consts from type_consts.h and reindexer_ctypes.h
const ( OpOr = 1 OpAnd = 2 OpNot = 3 ValueInt64 = 0 ValueDouble = 1 ValueString = 2 ValueBool = 3 ValueNull = 4 ValueInt = 8 ValueUndefined = 9 ValueComposite = 10 ValueTuple = 11 QueryCondition = 0 QueryDistinct = 1 QuerySortIndex = 2 QueryJoinOn = 3 QueryLimit = 4 QueryOffset = 5 QueryReqTotal = 6 QueryDebugLevel = 7 QueryAggregation = 8 QuerySelectFilter = 9 QuerySelectFunction = 10 QueryEnd = 11 QueryExplain = 12 QueryEqualPosition = 13 QueryUpdateField = 14 QueryAggregationLimit = 15 QueryAggregationOffset = 16 QueryAggregationSort = 17 QueryOpenBracket = 18 QueryCloseBracket = 19 QueryJoinCondition = 20 QueryDropField = 21 QueryUpdateObject = 22 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 QueryResultEnd = 0 QueryResultAggregation = 1 QueryResultExplain = 2 ResultsFormatMask = 0xF ResultsPure = 0x0 ResultsPtrs = 0x1 ResultsCJson = 0x2 ResultsJson = 0x3 ResultsWithPayloadTypes = 0x10 ResultsWithItemID = 0x20 ResultsWithPercents = 0x40 ResultsWithNsID = 0x80 ResultsWithJoined = 0x100 IndexOptPK = 1 << 7 IndexOptArray = 1 << 6 IndexOptDense = 1 << 5 IndexOptAppendable = 1 << 4 IndexOptSparse = 1 << 3 StorageOptEnabled = 1 StorageOptDropOnFileFormatError = 1 << 1 StorageOptCreateIfMissing = 1 << 2 ConnectOptOpenNamespaces = 1 ConnectOptAllowNamespaceErrors = 1 << 1 ConnectOptAutorepair = 1 << 2 ConnectOptWarnVersion = 1 << 4 ErrOK = 0 ErrParseSQL = 1 ErrQueryExec = 2 ErrParams = 3 ErrLogic = 4 ErrParseJson = 5 ErrParseDSL = 6 ErrConflict = 7 ErrParseBin = 8 ErrForbidden = 9 ErrWasRelock = 10 ErrNotValid = 11 ErrNetwork = 12 ErrNotFound = 13 ErrStateInvalidated = 14 ErrTimeout = 19 ErrCanceled = 20 ErrTagsMissmatch = 21 )
private go consts from type_consts.h and reindexer_ctypes.h
const ( StorageTypeLevelDB = 0 StorageTypeRocksDB = 1 )
const CInt32Max = int(^uint32(0) >> 1)
const ReindexerVersion = "v2.6.3"
Variables ¶
This section is empty.
Functions ¶
func RegisterBinding ¶
func RegisterBinding(name string, binding RawBinding)
Types ¶
type Completion ¶
type Completion func(err error)
type ConnectOptions ¶
func DefaultConnectOptions ¶
func DefaultConnectOptions() *ConnectOptions
func (*ConnectOptions) AllowNamespaceErrors ¶
func (so *ConnectOptions) AllowNamespaceErrors(value bool) *ConnectOptions
func (*ConnectOptions) OpenNamespaces ¶
func (so *ConnectOptions) OpenNamespaces(value bool) *ConnectOptions
func (*ConnectOptions) StorageType ¶
func (so *ConnectOptions) StorageType(value uint16) *ConnectOptions
Choose storage type
type IndexDef ¶ added in v1.9.7
type IndexDef struct { Name string `json:"name"` JSONPaths []string `json:"json_paths"` IndexType string `json:"index_type"` FieldType string `json:"field_type"` IsPK bool `json:"is_pk"` IsArray bool `json:"is_array"` IsDense bool `json:"is_dense"` IsSparse bool `json:"is_sparse"` CollateMode string `json:"collate_mode"` SortOrder string `json:"sort_order_letters"` ExpireAfter int `json:"expire_after"` Config interface{} `json:"config"` }
type NamespaceDef ¶ added in v1.9.7
type NamespaceDef struct { Namespace string `json:"name"` StorageOpts StorageOpts `json:"storage"` }
type OptionBuiltinWithServer ¶ added in v1.9.6
type OptionBuiltintCtxWatch ¶
OptionBuiltintCtxWatch - context watcher settings WatchDelay - minimal delay on context watcher goroutines launch. Timer resolution here is 20 ms WatchersPoolSize - watchers goroutine count (this doesn't affect goroutine count after WatchDelay expiration)
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 OptionConnect ¶
type OptionConnect struct {
CreateDBIfMissing bool
}
OptionConnect - DB connect options for server CreateDBIfMissing - allow to create DB on coonect if DB doesn't exist already
type OptionReindexerInstance ¶ added in v1.9.7
type OptionReindexerInstance struct {
Instance uintptr
}
type OptionRetryAttempts ¶ added in v1.9.5
type OptionTimeouts ¶
OptionTimeouts sets client-side network timeouts on login(connect) and requests Timer resolution here is 1 second
type RawBinding ¶
type RawBinding interface { Init(u *url.URL, options ...interface{}) error Clone() RawBinding OpenNamespace(ctx context.Context, namespace string, enableStorage, dropOnFileFormatError bool) error CloseNamespace(ctx context.Context, namespace string) error DropNamespace(ctx context.Context, namespace string) error TruncateNamespace(ctx context.Context, namespace string) error RenameNamespace(ctx context.Context, srcNs string, dstNs string) error EnableStorage(ctx context.Context, namespace string) error AddIndex(ctx context.Context, namespace string, indexDef IndexDef) error UpdateIndex(ctx context.Context, namespace string, indexDef IndexDef) error DropIndex(ctx context.Context, namespace, index string) error BeginTx(ctx context.Context, namespace string) (TxCtx, error) CommitTx(txCtx *TxCtx) (RawBuffer, error) RollbackTx(tx *TxCtx) error ModifyItemTx(txCtx *TxCtx, format int, data []byte, mode int, percepts []string, stateToken int) error ModifyItemTxAsync(txCtx *TxCtx, format int, data []byte, mode int, percepts []string, stateToken int, cmpl RawCompletion) DeleteQueryTx(txCtx *TxCtx, rawQuery []byte) error UpdateQueryTx(txCtx *TxCtx, rawQuery []byte) error PutMeta(ctx context.Context, namespace, key, data string) error GetMeta(ctx context.Context, namespace, key string) (RawBuffer, error) ModifyItem(ctx context.Context, nsHash int, namespace string, format int, data []byte, mode int, percepts []string, stateToken int) (RawBuffer, error) Select(ctx context.Context, query string, asJson bool, ptVersions []int32, fetchCount int) (RawBuffer, error) SelectQuery(ctx context.Context, rawQuery []byte, asJson bool, ptVersions []int32, fetchCount int) (RawBuffer, error) DeleteQuery(ctx context.Context, nsHash int, rawQuery []byte) (RawBuffer, error) UpdateQuery(ctx context.Context, nsHash int, rawQuery []byte) (RawBuffer, error) Commit(ctx context.Context, namespace string) error EnableLogger(logger Logger) DisableLogger() Ping(ctx context.Context) error Finalize() error Status(ctx context.Context) Status }
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 RawCompletion ¶
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 Status ¶ added in v1.10.4
type Status struct { Err error CProto StatusCProto Builtin StatusBuiltin }
type StatusBuiltin ¶ added in v1.10.4
type StatusCProto ¶ added in v1.10.4
type StorageOptions ¶
type StorageOptions uint16
func (*StorageOptions) DropOnFileFormatError ¶
func (so *StorageOptions) DropOnFileFormatError(value bool) *StorageOptions
func (*StorageOptions) Enabled ¶
func (so *StorageOptions) Enabled(value bool) *StorageOptions