boom

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: MIT Imports: 6 Imported by: 0

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 AECompatibleOperations added in v0.5.0

type AECompatibleOperations interface {
	Kind(src interface{}) string
	Key(src interface{}) datastore.Key
	KeyError(src interface{}) (datastore.Key, error)
	Get(dst interface{}) error
	GetMulti(dst interface{}) error
	Put(src interface{}) (datastore.Key, error)
	PutMulti(src interface{}) ([]datastore.Key, error)
	Delete(src interface{}) error
	DeleteMulti(src interface{}) error
}

type AECompatibleTransaction added in v0.5.0

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

func ToAECompatibleTransaction added in v0.5.0

func ToAECompatibleTransaction(tx *Transaction) *AECompatibleTransaction

func (*AECompatibleTransaction) Boom added in v0.5.0

func (tx *AECompatibleTransaction) Boom() *Boom

func (*AECompatibleTransaction) Commit added in v0.5.0

func (*AECompatibleTransaction) Delete added in v0.5.0

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

func (*AECompatibleTransaction) DeleteMulti added in v0.5.0

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

func (*AECompatibleTransaction) Get added in v0.5.0

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

func (*AECompatibleTransaction) GetMulti added in v0.5.0

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

func (*AECompatibleTransaction) Key added in v0.5.0

func (tx *AECompatibleTransaction) Key(src interface{}) datastore.Key

func (*AECompatibleTransaction) KeyError added in v0.5.0

func (tx *AECompatibleTransaction) KeyError(src interface{}) (datastore.Key, error)

func (*AECompatibleTransaction) Kind added in v0.5.0

func (tx *AECompatibleTransaction) Kind(src interface{}) string

func (*AECompatibleTransaction) Put added in v0.5.0

func (tx *AECompatibleTransaction) Put(src interface{}) (datastore.Key, error)

func (*AECompatibleTransaction) PutMulti added in v0.5.0

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

func (*AECompatibleTransaction) Rollback added in v0.5.0

func (tx *AECompatibleTransaction) Rollback() error

type Batch

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

func (*Batch) Delete

func (b *Batch) Delete(dst interface{}) chan error

func (*Batch) Exec

func (b *Batch) Exec() error

func (*Batch) Get

func (b *Batch) Get(dst interface{}) chan error

func (*Batch) Put

func (b *Batch) Put(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) AllocateID added in v0.4.0

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

func (*Boom) AllocateIDs added in v0.4.0

func (bm *Boom) AllocateIDs(src interface{}) ([]datastore.Key, error)

func (*Boom) Batch

func (bm *Boom) Batch() *Batch

func (*Boom) Count

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

func (*Boom) DecodeCursor added in v0.3.0

func (bm *Boom) DecodeCursor(s string) (datastore.Cursor, error)

func (*Boom) Delete

func (bm *Boom) Delete(src interface{}) error

func (*Boom) DeleteMulti

func (bm *Boom) DeleteMulti(src interface{}) error

func (*Boom) Get

func (bm *Boom) Get(dst interface{}) error

func (*Boom) GetAll

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

func (*Boom) GetMulti

func (bm *Boom) GetMulti(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() (*Transaction, error)

func (*Boom) Put

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

func (*Boom) PutMulti

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

func (*Boom) Run

func (bm *Boom) Run(q datastore.Query) *Iterator

func (*Boom) RunInTransaction

func (bm *Boom) RunInTransaction(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) Key added in v0.5.0

func (tx *Transaction) Key(src interface{}) datastore.Key

func (*Transaction) KeyError added in v0.5.0

func (tx *Transaction) KeyError(src interface{}) (datastore.Key, error)

func (*Transaction) Kind added in v0.5.0

func (tx *Transaction) Kind(src interface{}) string

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(dst interface{}) chan error

func (*TransactionBatch) Exec

func (b *TransactionBatch) Exec() error

func (*TransactionBatch) Get

func (b *TransactionBatch) Get(dst interface{}) chan error

func (*TransactionBatch) Put

func (b *TransactionBatch) Put(src interface{}) chan *datastore.TransactionPutResult

Jump to

Keyboard shortcuts

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