gae: go.chromium.org/gae/impl/memory Index | Files

package memory

import "go.chromium.org/gae/impl/memory"

Package memory provides an implementation of infra/gae/libs/wrapper which backs to local memory ONLY. This is useful for unittesting, and is also used for the nested-transaction filter implementation.

Debug EnvVars

To debug backend store memory access for a binary that uses this memory implementation, you may set the flag:

-luci.gae.store_trace_folder

to `/path/to/some/folder`. Every memory store will be assigned a numbered file in that folder, and all access to that store will be logged to that file. Setting this to "-" will cause the trace information to dump to stdout.

Index

Package Files

context.go datastore.go datastore_data.go datastore_index.go datastore_index_selection.go datastore_query.go datastore_query_execution.go doc.go error_markers.go info.go mail.go mail_static_lists.go memcache.go memstore.go memstore_iter.go memstore_tracing_utils.go module.go taskqueue.go taskqueue_data.go transaction.go user.go

Constants

const MaxIndexColumns = 64

MaxIndexColumns is the maximum number of index columns we're willing to support.

const MaxQueryComponents = 100

MaxQueryComponents was lifted from a hard-coded constant in dev_appserver. No idea if it's a real limit or just a convenience in the current dev appserver implementation.

func GetBinaryBounds Uses

func GetBinaryBounds(fq *ds.FinalizedQuery) (lower, upper []byte)

GetBinaryBounds gets the binary encoding of the upper and lower bounds of the inequality filter on fq, if any is defined. If a bound does not exist, it is nil.

NOTE: if fq specifies a descending sort order for the inequality, the bounds will be inverted, incremented, and flipped.

func NewDatastore Uses

func NewDatastore(c context.Context, inf info.RawInterface) ds.RawInterface

NewDatastore creates a new standalone memory implementation of the datastore, suitable for embedding for doing in-memory data organization.

It's configured by default with the following settings:

* AutoIndex(true)
* Consistent(true)
* DisableSpecialEntities(true)

These settings can of course be changed by using the Testable interface.

func Use Uses

func Use(c context.Context) context.Context

Use calls UseWithAppID with the appid of "app"

func UseInfo Uses

func UseInfo(c context.Context, aid string) context.Context

UseInfo adds an implementation for:

* go.chromium.org/gae/service/info

The application id wil be set to 'aid', and will not be modifiable in this context. If 'aid' contains a "~" character, it will be treated as the fully-qualified App ID and the AppID will be the string following the "~".

func UseWithAppID Uses

func UseWithAppID(c context.Context, aid string) context.Context

UseWithAppID adds implementations for the following gae services to the context:

* go.chromium.org/gae/service/datastore
* go.chromium.org/gae/service/info
* go.chromium.org/gae/service/mail
* go.chromium.org/gae/service/memcache
* go.chromium.org/gae/service/taskqueue
* go.chromium.org/gae/service/user
* go.chromium.org/luci/common/logger (using memlogger)

The application id wil be set to 'aid', and will not be modifiable in this context. If 'aid' contains a "~" character, it will be treated as the fully-qualified App ID and the AppID will be the string following the "~".

These can be retrieved with the gae.Get functions.

The implementations are all backed by an in-memory implementation, and start with an empty state.

Using this more than once per context.Context will cause a panic.

type ErrMissingIndex Uses

type ErrMissingIndex struct {
    Missing *ds.IndexDefinition
    // contains filtered or unexported fields
}

ErrMissingIndex is returned when the current indexes are not sufficient for the current query.

func (*ErrMissingIndex) Error Uses

func (e *ErrMissingIndex) Error() string

Package memory imports 43 packages (graph) and is imported by 7 packages. Updated 2018-08-15. Refresh now. Tools for package owners.