Documentation ¶
Overview ¶
Package datastore provides a set of functions to interact with Google Cloud Datastore.
It allows for operations such as creating a new client, saving a URL entity, retrieving a URL entity by its ID, and closing the client connection. This version has been updated to use the zap logger for consistent and structured logging.
Copyright (c) 2023 H0llyW00dzZ
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger *zap.Logger
Logger is a package-level variable to access the zap logger throughout the datastore package.
Functions ¶
func CloseClient ¶
CloseClient closes the Datastore client. It should be called to clean up resources and connections when the client is no longer needed. Logs an error if the client could not be closed, but does not return an error.
func CreateContext ¶
CreateContext creates a new context that can be used for Datastore operations. It returns a non-nil, empty context.
func CreateDatastoreClient ¶
CreateDatastoreClient creates a new client connected to Google Cloud Datastore. It requires a context and a projectID to initialize the connection. Returns a new Datastore client or an error if the connection could not be established.