fake

package
v0.0.0-...-80a9e2a Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Go Reference

golang.org/x/build/internal/datastore/fake

Package fake provides a fake implementation of a Datastore client to use in testing.

Documentation

Overview

Package fake provides a fake implementation of a Datastore client to use in testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a fake implementation of dsiface.Client to use in testing.

func (*Client) AllocateIDs

func (f *Client) AllocateIDs(context.Context, []*datastore.Key) ([]*datastore.Key, error)

AllocateIDs is unimplemented and panics.

func (*Client) Close

func (f *Client) Close() error

Close is unimplemented and panics.

func (*Client) Count

func (f *Client) Count(context.Context, *datastore.Query) (n int, err error)

Count is unimplemented and panics.

func (*Client) Delete

func (f *Client) Delete(context.Context, *datastore.Key) error

Delete is unimplemented and panics.

func (*Client) DeleteMulti

func (f *Client) DeleteMulti(context.Context, []*datastore.Key) (err error)

DeleteMulti is unimplemented and panics.

func (*Client) Get

func (f *Client) Get(_ context.Context, key *datastore.Key, dst interface{}) (err error)

Get loads the entity stored for key into dst, which must be a struct pointer.

func (*Client) GetAll

func (f *Client) GetAll(_ context.Context, q *datastore.Query, dst interface{}) (keys []*datastore.Key, err error)

GetAll runs the provided query in the given context and returns all keys that match that query, as well as appending the values to dst.

GetAll currently only supports a query of all entities of a given Kind, and a dst of a slice of pointers to structs.

func (*Client) GetMulti

func (f *Client) GetMulti(context.Context, []*datastore.Key, interface{}) (err error)

GetMulti is unimplemented and panics.

func (*Client) Mutate

func (f *Client) Mutate(context.Context, ...*datastore.Mutation) (ret []*datastore.Key, err error)

Mutate is unimplemented and panics.

func (*Client) NewTransaction

func (f *Client) NewTransaction(context.Context, ...datastore.TransactionOption) (t dsiface.Transaction, err error)

NewTransaction is unimplemented and panics.

func (*Client) Put

func (f *Client) Put(_ context.Context, key *datastore.Key, src interface{}) (*datastore.Key, error)

Put saves the entity src into the datastore with the given key. src must be a struct pointer.

func (*Client) PutMulti

func (f *Client) PutMulti(context.Context, []*datastore.Key, interface{}) (ret []*datastore.Key, err error)

PutMulti is unimplemented and panics.

func (*Client) Run

Run is unimplemented and panics.

func (*Client) RunInTransaction

func (f *Client) RunInTransaction(context.Context, func(tx dsiface.Transaction) error, ...datastore.TransactionOption) (cmt dsiface.Commit, err error)

RunInTransaction is unimplemented and panics.

Jump to

Keyboard shortcuts

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