Documentation
¶
Index ¶
- func AddStartWith(q firestore.Query, key string, word string) firestore.Query
- func CommitBulkWriter(ctx context.Context) (context.Context, error)
- func Create(ctx context.Context, colRef *firestore.CollectionRef, src any) error
- func Delete(ctx context.Context, docRef *firestore.DocumentRef) error
- func GenerateDocumentRef(cFirestore *firestore.Client, docRefs []*DocRef) *firestore.DocumentRef
- func Get(ctx context.Context, docRef *firestore.DocumentRef, dst any) (bool, error)
- func GetByQuery(ctx context.Context, query firestore.Query, dst any) (bool, error)
- func GetModelMapByBatchGetter[E, M any](bg TypedBatchGetter[E], getModel FuncGetModel[E, M]) map[string]*M
- func GetMulti(ctx context.Context, cFirestore *firestore.Client, ...) error
- func ListByQuery(ctx context.Context, query firestore.Query, dsts any) error
- func ListByQueryCursor(ctx context.Context, query firestore.Query, limit int, ...) (*firestore.DocumentSnapshot, error)
- func NewClient(projectID string) *firestore.Client
- func RunBulkWriter(ctx context.Context, cFirestore *firestore.Client) context.Context
- func RunTransaction(ctx context.Context, cFirestore *firestore.Client, ...) error
- func Set(ctx context.Context, docRef *firestore.DocumentRef, src any) error
- func Update(ctx context.Context, docRef *firestore.DocumentRef, kv map[string]any) error
- func ValidateCollectionRef(colRef *firestore.CollectionRef) bool
- func ValidateDocumentID(str string) bool
- func ValidateDocumentRef(docRef *firestore.DocumentRef) bool
- type BatchGetter
- type DocRef
- type FuncBindBatchGetter
- type FuncGetDoc
- type FuncGetModel
- type SummaryDocRef
- type TypedBatchGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddStartWith ¶
前方一致クエリを追加する
func CommitBulkWriter ¶ added in v1.5.0
func GenerateDocumentRef ¶
func GenerateDocumentRef(cFirestore *firestore.Client, docRefs []*DocRef) *firestore.DocumentRef
ドキュメント参照を作成する
func GetByQuery ¶
クエリで単体取得する(tx対応)
func GetModelMapByBatchGetter ¶ added in v1.5.6
func GetModelMapByBatchGetter[E, M any]( bg TypedBatchGetter[E], getModel FuncGetModel[E, M], ) map[string]*M
func GetMulti ¶
func GetMulti(ctx context.Context, cFirestore *firestore.Client, docRefs []*firestore.DocumentRef, dsts any) error
複数取得する(tx対応)
func ListByQuery ¶
クエリで複数取得する(tx対応)
func ListByQueryCursor ¶
func ListByQueryCursor(ctx context.Context, query firestore.Query, limit int, cursor *firestore.DocumentSnapshot, dsts any) (*firestore.DocumentSnapshot, error)
クエリで複数取得する(ページング)
func RunBulkWriter ¶ added in v1.5.0
func RunTransaction ¶ added in v1.0.6
func ValidateCollectionRef ¶ added in v1.4.0
func ValidateCollectionRef(colRef *firestore.CollectionRef) bool
正常な Path かチェック
func ValidateDocumentID ¶ added in v1.4.0
正常な DocumentID かチェック
func ValidateDocumentRef ¶ added in v1.4.0
func ValidateDocumentRef(docRef *firestore.DocumentRef) bool
正常な Path かチェック
Types ¶
type BatchGetter ¶ added in v1.5.6
type BatchGetter interface {
Add(docRef *firestore.DocumentRef, dst any)
Delete(docRef *firestore.DocumentRef)
Commit(ctx context.Context) error
Get(path string) any
}
func NewBatchGetter ¶ added in v1.5.6
func NewBatchGetter(cFirestore *firestore.Client) BatchGetter
type FuncBindBatchGetter ¶ added in v1.5.6
type FuncBindBatchGetter[T any] func(bg BatchGetter) TypedBatchGetter[T]
type FuncGetDoc ¶ added in v1.5.6
type FuncGetDoc func(ids ...string) *firestore.DocumentRef
type FuncGetModel ¶ added in v1.5.6
type SummaryDocRef ¶
最小のドキュメント参照(フロントに返せる)
func GenerateSummaryDocRef ¶
func GenerateSummaryDocRef(docRef *firestore.DocumentRef, rootCollectionPath string) *SummaryDocRef
最小のドキュメント参照を取得する
type TypedBatchGetter ¶ added in v1.5.6
type TypedBatchGetter[T any] interface { Add(ids ...string) Delete(ids ...string) GetMap() map[string]*T Get(ids ...string) *T Commit(ctx context.Context) error }
func NewTypedBatchGetter ¶ added in v1.5.6
func NewTypedBatchGetter[T any](bg BatchGetter, getDoc FuncGetDoc) TypedBatchGetter[T]
Click to show internal directories.
Click to hide internal directories.