firestore

package
v0.0.0-...-f6cb899 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 19 Imported by: 6

Documentation

Index

Constants

View Source
const (
	COLLECTION_COMMIT_COMMENTS    = "commit-comments"
	COLLECTION_TASK_COMMENTS      = "task-comments"
	COLLECTION_TASK_SPEC_COMMENTS = "task-spec-comments"

	// Firestore key for a comment's Timestamp field.
	KEY_TIMESTAMP = "Timestamp"
)
View Source
const (
	// At the moment, the only project with Firestore enabled is skia-firestore.
	FIRESTORE_PROJECT = firestore.FIRESTORE_PROJECT

	// Timeouts for various requests.
	GET_SINGLE_TIMEOUT = 10 * time.Second
	GET_MULTI_TIMEOUT  = 60 * time.Second
	PUT_SINGLE_TIMEOUT = 10 * time.Second
	PUT_MULTI_TIMEOUT  = 30 * time.Second

	// We'll perform this many attempts for a given request.
	DEFAULT_ATTEMPTS = 3

	// Load entries in at most 100 goroutines.
	MAX_LOAD_GOROUTINES = 100

	// Maximum documents in a transaction.
	MAX_TRANSACTION_DOCS = firestore.MAX_TRANSACTION_DOCS

	// Firestore key for a Task or Job's Created field.
	KEY_CREATED = "Created"

	// Firestore key for a Task or Job's DbModified field.
	KEY_DB_MODIFIED = "DbModified"

	// Firestore key for a Task or Job's Repo field.
	KEY_REPO = "Repo"

	// Estimated entry density, used for setting the initial size of results
	// collection data structures.
	EST_ENTRY_DENSITY = float64(1000) / float64(time.Hour)

	// Minimum and maximum estimated result set size.
	EST_RESULT_SIZE_MIN = 16
	EST_RESULT_SIZE_MAX = 8192
)
View Source
const (
	COLLECTION_JOBS = "jobs"
)
View Source
const (
	COLLECTION_TASKS = "tasks"
)

Variables

This section is empty.

Functions

func NewDB

func NewDB(ctx context.Context, client *firestore.Client) (db.DBCloser, error)

NewDB returns a db.DB which uses the given firestore.Client for storage.

func NewDBWithParams

func NewDBWithParams(ctx context.Context, project, instance string, ts oauth2.TokenSource) (db.DBCloser, error)

NewDB returns a db.DB which uses Cloud Firestore for storage, using the given params.

Types

This section is empty.

Jump to

Keyboard shortcuts

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