datastore

package
v0.0.0-...-a5508f6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns if the error is a datastore 404.

Types

type Client

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

Client is a wrapper around the datastore client. It should contain specific functions for this api.

func New

func New(ctx context.Context, project string) (Client, error)

New creates a wrapper around the datastore client, using the given GCP project.

func (Client) Close

func (c Client) Close()

Close will close the connection to datastore. Call this on program exit.

func (Client) GetUser

func (c Client) GetUser(ctx context.Context, id string) (plan.User, error)

GetUser retries a User struct from datastore.

func (Client) PutUser

func (c Client) PutUser(ctx context.Context, u plan.User) error

PutUser will save a User struct to datastore.

func (Client) QueryUsers

func (c Client) QueryUsers(ctx context.Context, p plan.Processor) error

Jump to

Keyboard shortcuts

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