datastore

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package datastore provides abstraction to datastore operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string

Direction represents the sorting direction.

const (
	DirectionASC  Direction = "ASC"
	DirectionDESC Direction = "DESC"
)

Possible ordering directions.

type Filter

type Filter struct {
	Path     string      `json:"path"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

Filter represents a filtering criteria.

type Order

type Order struct {
	Path      string    `json:"path"`
	Direction Direction `json:"direction"`
}

Order represents an ordering criteria.

type Query

type Query struct {
	Limit   int      `json:"limit"`
	Orders  []Order  `json:"orders"`
	Filters []Filter `json:"filters"`
}

Query represents the abstraction of any datastore query.

For a query with multiple Filters, they are treated as a set of criterion joined with AND condition behind the scenes.

For queries needing to use the OR condition, it is more efficient to split the query into multiple separate ones, run them separately in concurrently and combine the results afterwards.

Directories

Path Synopsis
Package firestore contains data structures and helper functions for using firebase firestore.
Package firestore contains data structures and helper functions for using firebase firestore.

Jump to

Keyboard shortcuts

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