Documentation ¶
Index ¶
- func NewParentField(src interface{}) *parentField
- func NotFound(err error) bool
- type CacheKey
- type CacheMetadata
- func (c *CacheMetadata) DeleteAll() error
- func (c *CacheMetadata) Has(key IURI) bool
- func (c *CacheMetadata) Load(key IURI, src interface{}) error
- func (c *CacheMetadata) Put(uri IURI, src interface{}) error
- func (c *CacheMetadata) PutMulti(datas []MetadataItem) error
- func (c *CacheMetadata) Save() error
- type CacheMetadataItem
- type CacheResult
- type CacheURI
- type ConditionURI
- type Conditions
- func (w *Conditions) CollectionGroup(collectionId string) *Conditions
- func (w *Conditions) CollectionGroupWithKey(key *Key) *Conditions
- func (c Conditions) CursorURI(key *Key) IURI
- func (c Conditions) HasConditions() bool
- func (c Conditions) HasNoConditions() bool
- func (c Conditions) Hash() string
- func (w *Conditions) Limit(limit int) *Conditions
- func (w *Conditions) Offset(offset int) *Conditions
- func (w *Conditions) OrderBy(column string, direction firestore.Direction) *Conditions
- func (c Conditions) Query(query firestore.Query, f *Foon) (firestore.Query, error)
- func (w *Conditions) StartAfter(cursor *Cursor) *Conditions
- func (c Conditions) String() string
- func (c Conditions) URI(key *Key) IURI
- func (w *Conditions) Where(column string, operation string, value interface{}) *Conditions
- type Cursor
- type CursorOrder
- type CursorQuery
- type FirestoreCache
- func (c *FirestoreCache) Delete(info *Key) error
- func (c *FirestoreCache) DeleteCache(path string) error
- func (c *FirestoreCache) DeleteMulti(keys []*Key) error
- func (c *FirestoreCache) Get(info *Key, src interface{}) error
- func (c *FirestoreCache) GetCache(path string, src interface{}) error
- func (c *FirestoreCache) GetEntity(src interface{}) error
- func (c *FirestoreCache) GetMulti(results map[string]*CacheResult) error
- func (c *FirestoreCache) Put(info *Key, src interface{}) error
- func (c *FirestoreCache) PutCache(path string, src interface{}) error
- func (c *FirestoreCache) PutEntity(src interface{}) error
- func (c *FirestoreCache) PutMulti(results []*KeyAndData) error
- type FirestoreClient
- type FirestoreClientImpl
- func (f *FirestoreClientImpl) Batch() (*firestore.WriteBatch, error)
- func (f *FirestoreClientImpl) Client() *firestore.Client
- func (f *FirestoreClientImpl) Create(dr *firestore.DocumentRef, data interface{}) error
- func (f *FirestoreClientImpl) Delete(dr *firestore.DocumentRef, opts ...firestore.Precondition) error
- func (f *FirestoreClientImpl) Documents(q firestore.Query) *firestore.DocumentIterator
- func (f *FirestoreClientImpl) Get(dr *firestore.DocumentRef) (*firestore.DocumentSnapshot, error)
- func (f *FirestoreClientImpl) GetAll(drs []*firestore.DocumentRef) ([]*firestore.DocumentSnapshot, error)
- func (f *FirestoreClientImpl) RunTransaction(fn func(ctx context.Context, fs *firestore.Transaction) error, ...) error
- func (f *FirestoreClientImpl) Set(dr *firestore.DocumentRef, data interface{}, opts ...firestore.SetOption) error
- func (f *FirestoreClientImpl) Update(dr *firestore.DocumentRef, data []firestore.Update, ...) error
- type FirestoreTransactionClient
- func (f *FirestoreTransactionClient) Batch() (*firestore.WriteBatch, error)
- func (f *FirestoreTransactionClient) Client() *firestore.Client
- func (f *FirestoreTransactionClient) Create(dr *firestore.DocumentRef, data interface{}) error
- func (f *FirestoreTransactionClient) Delete(dr *firestore.DocumentRef, opts ...firestore.Precondition) error
- func (f *FirestoreTransactionClient) Documents(q firestore.Query) *firestore.DocumentIterator
- func (f *FirestoreTransactionClient) Get(dr *firestore.DocumentRef) (*firestore.DocumentSnapshot, error)
- func (f *FirestoreTransactionClient) GetAll(drs []*firestore.DocumentRef) ([]*firestore.DocumentSnapshot, error)
- func (f *FirestoreTransactionClient) RunTransaction(fn func(ctx context.Context, fs *firestore.Transaction) error, ...) error
- func (f *FirestoreTransactionClient) Set(dr *firestore.DocumentRef, data interface{}, opts ...firestore.SetOption) error
- func (f *FirestoreTransactionClient) Update(dr *firestore.DocumentRef, data []firestore.Update, ...) error
- type Foon
- func (s *Foon) Batch() (WriteBatch, error)
- func (s *Foon) Delete(src interface{}) error
- func (s *Foon) Get(src interface{}) error
- func (s *Foon) GetAll(key *Key, src interface{}) error
- func (s *Foon) GetByKey(key *Key, src interface{}) error
- func (s *Foon) GetByQuery(key *Key, src interface{}, conditions *Conditions) error
- func (s *Foon) GetByQueryWithoutCache(key *Key, src interface{}, conditions *Conditions) error
- func (s *Foon) GetGroupByQuery(src interface{}, conditions *Conditions) error
- func (s *Foon) GetMulti(src interface{}) error
- func (s *Foon) GetMultiWithoutCache(src interface{}) error
- func (s *Foon) GetWithoutCache(src interface{}) error
- func (s *Foon) Insert(src interface{}) error
- func (s *Foon) InsertMulti(slices interface{}) error
- func (s *Foon) LastCursor() string
- func (s *Foon) Put(src interface{}) error
- func (s *Foon) PutMulti(slices interface{}) error
- func (s *Foon) RunInTransaction(fn func(f *Foon) error, options ...firestore.TransactionOption) error
- func (s *Foon) SetLogger(logger Logger)
- type FoonError
- type IURI
- type Key
- func (k Key) CollectionPath() string
- func (k Key) CreateCollectionRef(client *firestore.Client) *firestore.CollectionRef
- func (k Key) CreateDocumentRef(client *firestore.Client) *firestore.DocumentRef
- func (k Key) CreateGroupCollectionRef(client *firestore.Client) *firestore.CollectionGroupRef
- func (k Key) Equals(other *Key) bool
- func (k *Key) EqualsEntity(src interface{}) bool
- func (k Key) HasUniqueID() bool
- func (k *Key) Inject(src interface{}) error
- func (k *Key) IsSameKind(src interface{}) bool
- func (k *Key) ParentKey() *Key
- func (k Key) Path() string
- func (k *Key) SamePath(ref *firestore.DocumentRef) bool
- func (k Key) SelfPath() string
- func (k Key) URI() string
- func (k *Key) Update(fullPath string)
- type KeyAndData
- type Limit
- type Logger
- type MetadataItem
- type Offset
- type Order
- type Queries
- type Query
- type StartAfter
- type Where
- type WriteBatch
- type WriteBatchImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewParentField ¶
func NewParentField(src interface{}) *parentField
Types ¶
type CacheKey ¶
type CacheKey string
func (CacheKey) CreateCollectionURIByKey ¶ added in v0.10.0
func (CacheKey) CreateURIByKey ¶
type CacheMetadata ¶
type CacheMetadata struct { Item *CacheMetadataItem // contains filtered or unexported fields }
* クエリ結果などを保持するためのキャッシュ (関連のPut時には全削除される)
func LoadGroupMetaData ¶ added in v0.10.0
func LoadGroupMetaData(cache *FirestoreCache, key *Key) *CacheMetadata
func LoadMetadata ¶
func LoadMetadata(cache *FirestoreCache, key *Key) *CacheMetadata
func (*CacheMetadata) DeleteAll ¶
func (c *CacheMetadata) DeleteAll() error
func (*CacheMetadata) Has ¶
func (c *CacheMetadata) Has(key IURI) bool
func (*CacheMetadata) Load ¶
func (c *CacheMetadata) Load(key IURI, src interface{}) error
func (*CacheMetadata) Put ¶
func (c *CacheMetadata) Put(uri IURI, src interface{}) error
func (*CacheMetadata) PutMulti ¶
func (c *CacheMetadata) PutMulti(datas []MetadataItem) error
func (*CacheMetadata) Save ¶
func (c *CacheMetadata) Save() error
type CacheMetadataItem ¶
type CacheResult ¶
* キャッシュを取得する際の結果
type ConditionURI ¶
type ConditionURI string
func (ConditionURI) URI ¶
func (c ConditionURI) URI() string
type Conditions ¶
type Conditions struct { Queries Queries // contains filtered or unexported fields }
func NewConditions ¶
func NewConditions() *Conditions
func (*Conditions) CollectionGroup ¶ added in v0.10.0
func (w *Conditions) CollectionGroup(collectionId string) *Conditions
func (*Conditions) CollectionGroupWithKey ¶ added in v0.10.0
func (w *Conditions) CollectionGroupWithKey(key *Key) *Conditions
func (Conditions) CursorURI ¶ added in v0.10.0
func (c Conditions) CursorURI(key *Key) IURI
func (Conditions) HasConditions ¶
func (c Conditions) HasConditions() bool
func (Conditions) HasNoConditions ¶
func (c Conditions) HasNoConditions() bool
func (Conditions) Hash ¶
func (c Conditions) Hash() string
func (*Conditions) Limit ¶
func (w *Conditions) Limit(limit int) *Conditions
func (*Conditions) Offset ¶
func (w *Conditions) Offset(offset int) *Conditions
func (*Conditions) OrderBy ¶
func (w *Conditions) OrderBy(column string, direction firestore.Direction) *Conditions
func (*Conditions) StartAfter ¶ added in v0.10.0
func (w *Conditions) StartAfter(cursor *Cursor) *Conditions
func (Conditions) String ¶
func (c Conditions) String() string
func (Conditions) URI ¶
func (c Conditions) URI(key *Key) IURI
func (*Conditions) Where ¶
func (w *Conditions) Where(column string, operation string, value interface{}) *Conditions
type Cursor ¶ added in v0.10.0
type Cursor struct { ID string Path string Orders []CursorOrder }
* DocumentSnapshot使いづらいので粒度を上げるためのカーソル作成
func NewCursorWithSeed ¶ added in v0.10.0
func (Cursor) NewCursorWithOrders ¶ added in v0.10.0
func (Cursor) StringWithSeed ¶ added in v0.10.0
type CursorOrder ¶ added in v0.10.0
type CursorQuery ¶ added in v0.10.0
type FirestoreCache ¶
* Memcacheを扱う
func (*FirestoreCache) Delete ¶
func (c *FirestoreCache) Delete(info *Key) error
func (*FirestoreCache) DeleteCache ¶
func (c *FirestoreCache) DeleteCache(path string) error
func (*FirestoreCache) DeleteMulti ¶
func (c *FirestoreCache) DeleteMulti(keys []*Key) error
func (*FirestoreCache) Get ¶
func (c *FirestoreCache) Get(info *Key, src interface{}) error
func (*FirestoreCache) GetCache ¶
func (c *FirestoreCache) GetCache(path string, src interface{}) error
func (*FirestoreCache) GetEntity ¶
func (c *FirestoreCache) GetEntity(src interface{}) error
func (*FirestoreCache) GetMulti ¶
func (c *FirestoreCache) GetMulti(results map[string]*CacheResult) error
func (*FirestoreCache) Put ¶
func (c *FirestoreCache) Put(info *Key, src interface{}) error
func (*FirestoreCache) PutCache ¶
func (c *FirestoreCache) PutCache(path string, src interface{}) error
func (*FirestoreCache) PutEntity ¶
func (c *FirestoreCache) PutEntity(src interface{}) error
func (*FirestoreCache) PutMulti ¶
func (c *FirestoreCache) PutMulti(results []*KeyAndData) error
type FirestoreClient ¶
type FirestoreClient interface { Get(dr *firestore.DocumentRef) (*firestore.DocumentSnapshot, error) GetAll(drs []*firestore.DocumentRef) ([]*firestore.DocumentSnapshot, error) Create(dr *firestore.DocumentRef, data interface{}) error Set(dr *firestore.DocumentRef, data interface{}, opts ...firestore.SetOption) error Delete(dr *firestore.DocumentRef, opts ...firestore.Precondition) error Update(dr *firestore.DocumentRef, data []firestore.Update, opts ...firestore.Precondition) error Documents(q firestore.Query) *firestore.DocumentIterator Batch() (*firestore.WriteBatch, error) RunTransaction(fn func(ctx context.Context, fs *firestore.Transaction) error, opts ...firestore.TransactionOption) error Client() *firestore.Client }
type FirestoreClientImpl ¶
type FirestoreClientImpl struct {
// contains filtered or unexported fields
}
func (*FirestoreClientImpl) Batch ¶
func (f *FirestoreClientImpl) Batch() (*firestore.WriteBatch, error)
func (*FirestoreClientImpl) Client ¶
func (f *FirestoreClientImpl) Client() *firestore.Client
func (*FirestoreClientImpl) Create ¶
func (f *FirestoreClientImpl) Create(dr *firestore.DocumentRef, data interface{}) error
func (*FirestoreClientImpl) Delete ¶
func (f *FirestoreClientImpl) Delete(dr *firestore.DocumentRef, opts ...firestore.Precondition) error
func (*FirestoreClientImpl) Documents ¶
func (f *FirestoreClientImpl) Documents(q firestore.Query) *firestore.DocumentIterator
func (*FirestoreClientImpl) Get ¶
func (f *FirestoreClientImpl) Get(dr *firestore.DocumentRef) (*firestore.DocumentSnapshot, error)
func (*FirestoreClientImpl) GetAll ¶
func (f *FirestoreClientImpl) GetAll(drs []*firestore.DocumentRef) ([]*firestore.DocumentSnapshot, error)
func (*FirestoreClientImpl) RunTransaction ¶
func (f *FirestoreClientImpl) RunTransaction(fn func(ctx context.Context, fs *firestore.Transaction) error, opts ...firestore.TransactionOption) error
func (*FirestoreClientImpl) Set ¶
func (f *FirestoreClientImpl) Set(dr *firestore.DocumentRef, data interface{}, opts ...firestore.SetOption) error
func (*FirestoreClientImpl) Update ¶
func (f *FirestoreClientImpl) Update(dr *firestore.DocumentRef, data []firestore.Update, opts ...firestore.Precondition) error
type FirestoreTransactionClient ¶
type FirestoreTransactionClient struct {
// contains filtered or unexported fields
}
func (*FirestoreTransactionClient) Batch ¶
func (f *FirestoreTransactionClient) Batch() (*firestore.WriteBatch, error)
func (*FirestoreTransactionClient) Client ¶
func (f *FirestoreTransactionClient) Client() *firestore.Client
func (*FirestoreTransactionClient) Create ¶
func (f *FirestoreTransactionClient) Create(dr *firestore.DocumentRef, data interface{}) error
func (*FirestoreTransactionClient) Delete ¶
func (f *FirestoreTransactionClient) Delete(dr *firestore.DocumentRef, opts ...firestore.Precondition) error
func (*FirestoreTransactionClient) Documents ¶
func (f *FirestoreTransactionClient) Documents(q firestore.Query) *firestore.DocumentIterator
func (*FirestoreTransactionClient) Get ¶
func (f *FirestoreTransactionClient) Get(dr *firestore.DocumentRef) (*firestore.DocumentSnapshot, error)
func (*FirestoreTransactionClient) GetAll ¶
func (f *FirestoreTransactionClient) GetAll(drs []*firestore.DocumentRef) ([]*firestore.DocumentSnapshot, error)
func (*FirestoreTransactionClient) RunTransaction ¶
func (f *FirestoreTransactionClient) RunTransaction(fn func(ctx context.Context, fs *firestore.Transaction) error, opts ...firestore.TransactionOption) error
func (*FirestoreTransactionClient) Set ¶
func (f *FirestoreTransactionClient) Set(dr *firestore.DocumentRef, data interface{}, opts ...firestore.SetOption) error
func (*FirestoreTransactionClient) Update ¶
func (f *FirestoreTransactionClient) Update(dr *firestore.DocumentRef, data []firestore.Update, opts ...firestore.Precondition) error
type Foon ¶
func NewStoreWithProjectID ¶
func (*Foon) Batch ¶
func (s *Foon) Batch() (WriteBatch, error)
func (*Foon) GetByQuery ¶
func (s *Foon) GetByQuery(key *Key, src interface{}, conditions *Conditions) error
func (*Foon) GetByQueryWithoutCache ¶
func (s *Foon) GetByQueryWithoutCache(key *Key, src interface{}, conditions *Conditions) error
func (*Foon) GetGroupByQuery ¶ added in v0.10.0
func (s *Foon) GetGroupByQuery(src interface{}, conditions *Conditions) error
func (*Foon) GetMultiWithoutCache ¶
func (*Foon) GetWithoutCache ¶
func (*Foon) InsertMulti ¶
func (*Foon) LastCursor ¶ added in v0.10.0
func (*Foon) RunInTransaction ¶
type Key ¶
func NewKeyWithPath ¶
func (Key) CollectionPath ¶
func (Key) CreateCollectionRef ¶
func (k Key) CreateCollectionRef(client *firestore.Client) *firestore.CollectionRef
func (Key) CreateDocumentRef ¶
func (k Key) CreateDocumentRef(client *firestore.Client) *firestore.DocumentRef
func (Key) CreateGroupCollectionRef ¶ added in v0.10.0
func (k Key) CreateGroupCollectionRef(client *firestore.Client) *firestore.CollectionGroupRef
func (*Key) EqualsEntity ¶ added in v0.10.0
func (Key) HasUniqueID ¶
func (*Key) IsSameKind ¶ added in v0.10.0
type KeyAndData ¶
type KeyAndData struct { Key *Key Src interface{} }
type MetadataItem ¶
type MetadataItem struct { Key IURI Data interface{} }
type StartAfter ¶ added in v0.10.0
type StartAfter struct { }
func (StartAfter) Hash ¶ added in v0.10.0
func (w StartAfter) Hash(cursor *Cursor) string
type WriteBatch ¶
type WriteBatch interface { Create(data interface{}) WriteBatch Set(data interface{}, opts ...firestore.SetOption) WriteBatch Delete(key *Key, opts ...firestore.Precondition) WriteBatch Commit() error }
type WriteBatchImpl ¶
type WriteBatchImpl struct {
// contains filtered or unexported fields
}
func (*WriteBatchImpl) Commit ¶
func (b *WriteBatchImpl) Commit() error
func (*WriteBatchImpl) Create ¶
func (b *WriteBatchImpl) Create(data interface{}) WriteBatch
func (*WriteBatchImpl) Delete ¶
func (b *WriteBatchImpl) Delete(key *Key, opts ...firestore.Precondition) WriteBatch
func (*WriteBatchImpl) Set ¶
func (b *WriteBatchImpl) Set(data interface{}, opts ...firestore.SetOption) WriteBatch
Click to show internal directories.
Click to hide internal directories.