datastore

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConf = errors.New("missing PROJECT_ID")
	ErrNoDatastore = errors.New("google datastore is not initialized")
	ErrNoStorage   = errors.New("google cloud storage is not initialized")
)

Functions

func Close

func Close()

Close the platform related clients

func DataStore

func DataStore() *ds.Client

DataStore returns a reference to the datastore client

func Storage

func Storage() *storage.Client

Storage returns a reference to the storage client

Types

type Client

type Client struct {
	DatastoreClient *ds.Client
	StorageClient   *storage.Client
}

Client holds all clients needed to access basic Google Cloud services

func NewClient

func NewClient(ctx context.Context, projectID, serviceName string) (*Client, error)

NewClient creates a new client

func (*Client) Close

func (c *Client) Close()

Close closes all clients to the Google Cloud services

Jump to

Keyboard shortcuts

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