ent

package
v0.0.0-...-ed9fe1d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package ent provides the helper types and functions for code generated by ent tool

Index

Constants

View Source
const (
	AtomTrue  = search.Atom("true")
	AtomFalse = search.Atom("false")
)

constant variables for search doc conversion

View Source
const LoggerKey = "gae.datastore.ent"

LoggerKey is a key of logger in this package.

View Source
const MaxEntsPerPutDelete = 200

MaxEntsPerPutDelete is a maxmum number of entities to be passed to PutMulti or DeleteMulti.

Variables

View Source
var (
	// ErrTooManyEnts is returned when the user passes too many entities to PutMulti or DeleteMulti.
	ErrTooManyEnts = fmt.Errorf("ent: too many documents given to put or delete (max is %d)", MaxEntsPerPutDelete)
)

Functions

func BoolToAtom

func BoolToAtom(b bool) search.Atom

BoolToAtom to convert boolean value to search.Atom

func BytesToHTML

func BytesToHTML(buff []byte) search.HTML

BytesToHTML to convert []byte value to search.HTML

func GetMemcacheKey

func GetMemcacheKey(k *datastore.Key) string

GetMemcacheKey returns memcache key correspoding to *datastore.Key "datastore.{namespace}.{kind}.{StringID|IntID}" is used.

func IsFieldError

func IsFieldError(err error) bool

IsFieldError returns whether err is an instance of *FieldError

func ParseBool

func ParseBool(v string) bool

ParseBool parse bool value

func ParseFloat32

func ParseFloat32(v string) float32

ParseFloat32 parse int64 value

func ParseFloat64

func ParseFloat64(v string) float64

ParseFloat64 parse int64 value

func ParseInt

func ParseInt(v string) int

ParseInt parse int value

func ParseInt64

func ParseInt64(v string) int64

ParseInt64 parse int64 value

func ParseStringList

func ParseStringList(v string) []string

ParseStringList parse []string value

func ParseTime

func ParseTime(v string) time.Time

ParseTime parse time.Time value

Types

type BeforeSave

type BeforeSave interface {
	BeforeSave(ctx context.Context) error
}

type BfterSave

type BfterSave interface {
	AeforeSave(ctx context.Context) error
}

type FieldError

type FieldError struct {
	Field   string
	Message string
}

func NewFieldError

func NewFieldError(field, message string) *FieldError

NewFieldError returns a new *FieldError instance

func (*FieldError) Error

func (fe *FieldError) Error() string

Directories

Path Synopsis
Package generator provides types and functions for ent generator.
Package generator provides types and functions for ent generator.

Jump to

Keyboard shortcuts

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