Documentation ¶
Overview ¶
Package ent provides the helper types and functions for code generated by ent tool
Index ¶
- Constants
- Variables
- func BoolToAtom(b bool) search.Atom
- func BytesToHTML(buff []byte) search.HTML
- func GetMemcacheKey(k *datastore.Key) string
- func IsFieldError(err error) bool
- func ParseBool(v string) bool
- func ParseFloat32(v string) float32
- func ParseFloat64(v string) float64
- func ParseInt(v string) int
- func ParseInt64(v string) int64
- func ParseStringList(v string) []string
- func ParseTime(v string) time.Time
- type BeforeSave
- type BfterSave
- type FieldError
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 ¶
BoolToAtom to convert boolean value to search.Atom
func BytesToHTML ¶
BytesToHTML to convert []byte value to search.HTML
func GetMemcacheKey ¶
GetMemcacheKey returns memcache key correspoding to *datastore.Key "datastore.{namespace}.{kind}.{StringID|IntID}" is used.
func IsFieldError ¶
IsFieldError returns whether err is an instance of *FieldError
Types ¶
type BeforeSave ¶
type FieldError ¶
func NewFieldError ¶
func NewFieldError(field, message string) *FieldError
NewFieldError returns a new *FieldError instance
func (*FieldError) Error ¶
func (fe *FieldError) Error() string
Click to show internal directories.
Click to hide internal directories.