boom

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: MIT Imports: 6 Imported by: 24

README

boom

BOOM HEADSHOT!

goon likes interface for go.mercari.io/datastore.

boom doesn't have cache layer. It will be coming to go.mercari.io/datastore package.

boom doing only struct → key and key → struct mapping.

Important Notice

There are incompatible behaviors in the following points.

  • *boom.Transaction#Put will not set ID immediate.
    • It will be set after boom.Transaction#Commit.
    • If you want to get ID/Name asap, You should use datastore.Client#AllocatedIDs.

TODO

  • namespace

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func (*Batch) Delete

func (b *Batch) Delete(ctx context.Context, dst interface{}) chan error

func (*Batch) Exec

func (b *Batch) Exec(ctx context.Context) error

func (*Batch) Get

func (b *Batch) Get(ctx context.Context, dst interface{}) chan error

func (*Batch) Put

func (b *Batch) Put(ctx context.Context, src interface{}) chan *datastore.PutResult

type Boom

type Boom struct {
	Context context.Context
	Client  datastore.Client
}

func FromClient

func FromClient(ctx context.Context, client datastore.Client) *Boom

func FromContext

func FromContext(ctx context.Context) (*Boom, error)

func (*Boom) Batch

func (bm *Boom) Batch() *Batch

func (*Boom) Count

func (bm *Boom) Count(ctx context.Context, q datastore.Query) (int, error)

func (*Boom) Delete

func (bm *Boom) Delete(ctx context.Context, src interface{}) error

func (*Boom) DeleteMulti

func (bm *Boom) DeleteMulti(ctx context.Context, src interface{}) error

func (*Boom) Get

func (bm *Boom) Get(ctx context.Context, dst interface{}) error

func (*Boom) GetAll

func (bm *Boom) GetAll(ctx context.Context, q datastore.Query, dst interface{}) ([]datastore.Key, error)

func (*Boom) GetMulti

func (bm *Boom) GetMulti(ctx context.Context, dst interface{}) error

func (*Boom) Key

func (bm *Boom) Key(src interface{}) datastore.Key

func (*Boom) KeyError

func (bm *Boom) KeyError(src interface{}) (datastore.Key, error)

func (*Boom) Kind

func (bm *Boom) Kind(src interface{}) string

func (*Boom) NewTransaction

func (bm *Boom) NewTransaction(ctx context.Context) (*Transaction, error)

func (*Boom) Put

func (bm *Boom) Put(ctx context.Context, src interface{}) (datastore.Key, error)

func (*Boom) PutMulti

func (bm *Boom) PutMulti(ctx context.Context, src interface{}) ([]datastore.Key, error)

func (*Boom) Run

func (bm *Boom) Run(ctx context.Context, q datastore.Query) *Iterator

func (*Boom) RunInTransaction

func (bm *Boom) RunInTransaction(ctx context.Context, f func(tx *Transaction) error) (datastore.Commit, error)

type Iterator

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

func (*Iterator) Cursor

func (it *Iterator) Cursor() (datastore.Cursor, error)

func (*Iterator) Next

func (it *Iterator) Next(dst interface{}) (datastore.Key, error)

type Transaction

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

func (*Transaction) Batch

func (tx *Transaction) Batch() *TransactionBatch

func (*Transaction) Commit

func (tx *Transaction) Commit() (datastore.Commit, error)

func (*Transaction) Delete

func (tx *Transaction) Delete(src interface{}) error

func (*Transaction) DeleteMulti

func (tx *Transaction) DeleteMulti(src interface{}) error

func (*Transaction) Get

func (tx *Transaction) Get(dst interface{}) error

func (*Transaction) GetMulti

func (tx *Transaction) GetMulti(dst interface{}) error

func (*Transaction) Put

func (tx *Transaction) Put(src interface{}) (datastore.PendingKey, error)

func (*Transaction) PutMulti

func (tx *Transaction) PutMulti(src interface{}) ([]datastore.PendingKey, error)

func (*Transaction) Rollback

func (tx *Transaction) Rollback() error

type TransactionBatch

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

func (*TransactionBatch) Delete

func (b *TransactionBatch) Delete(ctx context.Context, dst interface{}) chan error

func (*TransactionBatch) Exec

func (b *TransactionBatch) Exec(ctx context.Context) error

func (*TransactionBatch) Get

func (b *TransactionBatch) Get(ctx context.Context, dst interface{}) chan error

func (*TransactionBatch) Put

func (b *TransactionBatch) Put(ctx context.Context, src interface{}) chan *datastore.TransactionPutResult

Jump to

Keyboard shortcuts

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