firestore

package
v0.0.0-...-b2f7ccc Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderByAsc  = "asc"  // 昇順
	OrderByDesc = "desc" // 降順
)

ソート順

Variables

This section is empty.

Functions

This section is empty.

Types

type Firestore

type Firestore struct {
	Client *firestore.Client
}

Firestore - Firestoreの構造体

func NewClient

func NewClient(ctx context.Context, app *firebase.App) (*Firestore, error)

NewClient - Firestoreに接続

func (*Firestore) Close

func (f *Firestore) Close() error

Close - Firestoreとの接続を終了

func (*Firestore) DeleteDoc

func (f *Firestore) DeleteDoc(ctx context.Context, collection string, document string) error

DeleteDoc - ドキュメントを削除

func (*Firestore) Get

func (f *Firestore) Get(ctx context.Context, collection string, document string) (*firestore.DocumentSnapshot, error)

Get - 単一のドキュメントの内容を取得

func (*Firestore) List

func (f *Firestore) List(
	ctx context.Context, collection string, params *Params, queries []*Query,
) ([]*firestore.DocumentSnapshot, error)

List - コレクション内のドキュメントを福数取得

func (*Firestore) Search

func (f *Firestore) Search(
	ctx context.Context, collection string, params *Params, value string,
) ([]*firestore.DocumentSnapshot, error)

Search - 前方一致検索

func (*Firestore) Set

func (f *Firestore) Set(ctx context.Context, collection string, document string, data interface{}) error

Set - 単一のドキュメントを作成または上書き

type Params

type Params struct {
	Offset     string
	Limit      int
	OrderField string
	OrderBy    string
}

Params - Where()メソッドで使用するクエリ構造体

type Query

type Query struct {
	Field    string
	Operator string // <, <=, >, >=, ==, !=, array-contains, array-contains-any, in, not-int
	Value    interface{}
}

Query - Where()メソッドのフィルタリング使用するクエリ構造体

Jump to

Keyboard shortcuts

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