cloudfirestore

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 16 Imported by: 3 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStartWith

func AddStartWith(q firestore.Query, key string, word string) firestore.Query

前方一致クエリを追加する

func CommitBulkWriter added in v1.5.0

func CommitBulkWriter(ctx context.Context) (context.Context, error)

func Create

func Create(ctx context.Context, colRef *firestore.CollectionRef, src any) error

作成する(tx, bw対応)

func Delete

func Delete(ctx context.Context, docRef *firestore.DocumentRef) error

削除する(tx, bw対応)

func GenerateDocumentRef

func GenerateDocumentRef(cFirestore *firestore.Client, docRefs []*DocRef) *firestore.DocumentRef

ドキュメント参照を作成する

func Get

func Get(ctx context.Context, docRef *firestore.DocumentRef, dst any) (bool, error)

単体取得する(tx対応)

func GetByQuery

func GetByQuery(ctx context.Context, query firestore.Query, dst any) (bool, error)

クエリで単体取得する(tx対応)

func GetMulti

func GetMulti(ctx context.Context, cFirestore *firestore.Client, docRefs []*firestore.DocumentRef, dsts any) error

複数取得する(tx対応)

func ListByQuery

func ListByQuery(ctx context.Context, query firestore.Query, dsts any) error

クエリで複数取得する(tx対応)

func ListByQueryCursor

func ListByQueryCursor(ctx context.Context, query firestore.Query, limit int, cursor *firestore.DocumentSnapshot, dsts any) (*firestore.DocumentSnapshot, error)

クエリで複数取得する(ページング)

func NewClient

func NewClient(projectID string) *firestore.Client

func RunBulkWriter added in v1.5.0

func RunBulkWriter(ctx context.Context, cFirestore *firestore.Client) context.Context

func RunTransaction added in v1.0.6

func RunTransaction(ctx context.Context, cFirestore *firestore.Client, fn func(ctx context.Context) error, opts ...firestore.TransactionOption) error

func Set

func Set(ctx context.Context, docRef *firestore.DocumentRef, src any) error

上書きする(tx, bw対応)

func Update

func Update(ctx context.Context, docRef *firestore.DocumentRef, kv map[string]any) error

更新する(tx, bw対応)

func ValidateCollectionRef added in v1.4.0

func ValidateCollectionRef(colRef *firestore.CollectionRef) bool

正常な Path かチェック

func ValidateDocumentID added in v1.4.0

func ValidateDocumentID(str string) bool

正常な DocumentID かチェック

func ValidateDocumentRef added in v1.4.0

func ValidateDocumentRef(docRef *firestore.DocumentRef) bool

正常な Path かチェック

Types

type DocRef

type DocRef struct {
	CollectionName string `json:"collection_name"`
	DocID          string `json:"doc_id"`
}

個別のドキュメント参照

type SummaryDocRef

type SummaryDocRef struct {
	ID   string `json:"id"`
	Path string `json:"path"`
}

最小のドキュメント参照(フロントに返せる)

func GenerateSummaryDocRef

func GenerateSummaryDocRef(docRef *firestore.DocumentRef, rootCollectionPath string) *SummaryDocRef

最小のドキュメント参照を取得する

Jump to

Keyboard shortcuts

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