firestore

package
v0.0.0-...-b1b3351 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReportService

type ReportService struct {
	// contains filtered or unexported fields
}

func NewReportService

func NewReportService(ctx context.Context, projectID, collectionID string) (ReportService, error)

NewReportService returns a new repository wrapping a Firestore client. The client uses the given project and create documents to and retrieve documents from the given collection.

func (ReportService) Close

func (s ReportService) Close() error

Close closes the connection to Firestore client.

func (ReportService) Create

func (s ReportService) Create(ctx context.Context, data benchttp.Report) (string, error)

Create creates a new document from data inside Firestore. Returns an error if the document could not be created.

func (ReportService) Retrieve

func (s ReportService) Retrieve(ctx context.Context, id string) (benchttp.Report, error)

Retrieve retrieves a document from Firestore given its ID. Returns an error if the document could not be found or if the document could not be converted into a Report struct.

Jump to

Keyboard shortcuts

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