aspect

package module
v0.0.0-...-06f14f4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 6 Imported by: 0

README

gstore

A Google Cloud Datastore Extension

Documentation

Index

Constants

View Source
const PrimaryKey = "__key__"

PrimaryKey is the primary key name

Variables

This section is empty.

Functions

func Prepare

func Prepare(entity Entity)

Prepare entity for datastore operation

func String

func String(value string) *string

String creates a pointer to a string

func StringValue

func StringValue(value *string) string

StringValue returns the string's value from pointer

Types

type Entity

type Entity interface {
	Key() *datastore.Key
	Namespace() string
	Kind() string
}

Entity represents the entity

type PropertyList

type PropertyList []datastore.Property

PropertyList converts a []Property to implement PropertyLoadSaver.

func (*PropertyList) Append

func (list *PropertyList) Append(prop datastore.Property)

Append inserts a property to *list

func (*PropertyList) Load

func (list *PropertyList) Load(properties []datastore.Property) error

Load loads all of the provided properties into list. It does not first reset *list to an empty slice.

func (*PropertyList) LoadFromStruct

func (list *PropertyList) LoadFromStruct(input interface{}, names ...string) error

LoadFromStruct loads all of the struct's properties into l. It does not first reset *l to an empty slice.

func (*PropertyList) LoadStruct

func (list *PropertyList) LoadStruct(input interface{}) error

LoadStruct loads the properties from *list to dst. dst must be a struct pointer.

The values of dst's unmatched struct fields are not modified, and matching slice-typed fields are not reset before appending to them. In particular, it is recommended to pass a pointer to a zero valued struct on each LoadStruct call.

func (*PropertyList) Save

func (list *PropertyList) Save() ([]datastore.Property, error)

Save saves all of list's properties as a slice of Properties.

type UniqueConstraint

type UniqueConstraint struct {
	Client *datastore.Client
}

UniqueConstraint represents a unique constraint in datastore

func (*UniqueConstraint) Check

func (u *UniqueConstraint) Check(tx *datastore.Transaction, input Entity) error

Check the unique contrants

Jump to

Keyboard shortcuts

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