Categorygithub.com/dal-go/dalgo2datastore
modulepackage
0.0.96
Repository: https://github.com/dal-go/dalgo2datastore.git
Documentation: pkg.go.dev

# README

github.com/dal-go/dalgo2datastore

Bridge of Google Cloud Datastore API for github.com/dal-go/dalgo interface.

This uses cloud.google.com/go/datastore package.

Why "cloud.google.com/go/datastore" and not "google.golang.org/appengine/v2/datastore"?

The difference between the two Go packages cloud.google.com/go/datastore and google.golang.org/appengine/v2/datastore lies in the Google Cloud products they are designed to work with and their functionality.

cloud.google.com/go/datastore:

This package is the official Go client library for Google Cloud Datastore, which is a highly-scalable, NoSQL database for web and mobile applications provided by Google Cloud Platform. It can be used with various Google Cloud products and services, not just App Engine. The package enables your application to interact with the Datastore API, allowing you to store, query, and manage data.

The cloud.google.com/go/datastore package is recommended for new projects that require Datastore functionality. It supports all the features of the Datastore API, and works with both App Engine standard and flexible environments, as well as other environments like Kubernetes Engine or Compute Engine.

google.golang.org/appengine/v2/datastore:

This package is part of the App Engine SDK for Go and is designed specifically for use with the App Engine Standard Environment. It provides a slightly different API for working with Datastore compared to the cloud.google.com/go/datastore package. The package is tailored to the App Engine environment, which means it may not be suitable for use outside of App Engine or in newer runtime environments like the second generation of the App Engine standard environment.

TL/DR:

The cloud.google.com/go/datastore package is recommended for new projects as it is more versatile and works across various Google Cloud products and services, whereas the google.golang.org/appengine/v2/datastore package is primarily meant for use with the App Engine standard environment.

Similar projects

# Packages

No description provided by the author

# Functions

CleanProperties removes properties in place and returns filtered slice.
IsDuplicate indicates property is duplicate.
IsEmptyByteArray returns true of property value is nil or empty byte array.
IsEmptyJSON returns true if property value is empty string or empty array or empty object.
IsEmptyString returns true if property value iz empty string.
IsEmptyStringOrSpecificValue returns true if property value is empty string or has specific value.
IsFalse returns true if propertry value is false.
IsObsolete used for obsolete properties.
IsZeroBool returns true if property value false.
IsZeroFloat returns true if property value 0.0.
IsZeroInt returns true if property value is 0.
IsZeroTime returns true of property value iz zero time.
NewDatabase create database provider to Google Datastore.

# Variables

ErrEmptyKind indicates record holder returned empty kind.
TODO: move to Context.WithValue().
NewIncompleteKey creates new incomplete key.
NewKey creates new key.
Put saves record to datastore.
PutMulti saves multipe entities to datastore.

# Structs

SaverWrapper used to serialize struct to properties on saving.

# Type aliases

IsOkToRemove checks if it's OK to remove property value.