Documentation ¶
Index ¶
- Variables
- func FavclipTools(t *testing.T, ctx context.Context, client datastore.Client)
- type Plugger
- type Plugin
- type User
- type UserID
- type UserJSON
- type UserJSONBuilder
- func (b *UserJSONBuilder) Add(info *UserPropertyInfo) *UserJSONBuilder
- func (b *UserJSONBuilder) AddAll() *UserJSONBuilder
- func (b *UserJSONBuilder) Convert(orig *User) (*UserJSON, error)
- func (b *UserJSONBuilder) ConvertList(orig []*User) (UserJSONList, error)
- func (b *UserJSONBuilder) Marshal(orig *User) ([]byte, error)
- func (b *UserJSONBuilder) Remove(info *UserPropertyInfo) *UserJSONBuilder
- type UserJSONList
- type UserPropertyDecoder
- type UserPropertyEncoder
- type UserPropertyInfo
- type UserQueryBuilder
- func (bldr *UserQueryBuilder) Ancestor(parentKey datastore.Key) *UserQueryBuilder
- func (bldr *UserQueryBuilder) KeysOnly() *UserQueryBuilder
- func (bldr *UserQueryBuilder) Limit(limit int) *UserQueryBuilder
- func (bldr *UserQueryBuilder) Offset(offset int) *UserQueryBuilder
- func (bldr *UserQueryBuilder) Query() datastore.Query
- func (bldr *UserQueryBuilder) Start(cur datastore.Cursor) *UserQueryBuilder
- type UserQueryProperty
- func (p *UserQueryProperty) Asc() *UserQueryBuilder
- func (p *UserQueryProperty) Desc() *UserQueryBuilder
- func (p *UserQueryProperty) Equal(value interface{}) *UserQueryBuilder
- func (p *UserQueryProperty) Filter(op string, value interface{}) *UserQueryBuilder
- func (p *UserQueryProperty) GreaterThan(value interface{}) *UserQueryBuilder
- func (p *UserQueryProperty) GreaterThanOrEqual(value interface{}) *UserQueryBuilder
- func (p *UserQueryProperty) LessThan(value interface{}) *UserQueryBuilder
- func (p *UserQueryProperty) LessThanOrEqual(value interface{}) *UserQueryBuilder
Constants ¶
This section is empty.
Variables ¶
var TestSuite = map[string]testsuite.Test{ "FavclipTools": FavclipTools, }
Functions ¶
Types ¶
type Plugin ¶
type Plugin interface { Init(typeName string) Ancestor(ancestor datastore.Key) KeysOnly() Start(cur datastore.Cursor) Offset(offset int) Limit(limit int) Filter(name, op string, value interface{}) Asc(name string) Desc(name string) }
Plugin supply hook point for query constructions.
type User ¶
type User struct { ID UserID `datastore:"-" boom:"id" json:"id"` Name string `json:"name"` MentorID UserID `json:"mentorID"` }
User kind +jwg +qbg
type UserID ¶
type UserID int64
func (UserID) FromPropertyValue ¶
func (UserID) MarshalJSON ¶
func (UserID) ToPropertyValue ¶
func (*UserID) UnmarshalJSON ¶
type UserJSON ¶
type UserJSON struct { ID UserID `json:"id,omitempty"` Name string `json:"name,omitempty"` MentorID UserID `json:"mentorID,omitempty"` }
UserJSON is jsonized struct for User.
type UserJSONBuilder ¶
type UserJSONBuilder struct { ID *UserPropertyInfo Name *UserPropertyInfo MentorID *UserPropertyInfo // contains filtered or unexported fields }
UserJSONBuilder convert between User to UserJSON mutually.
func NewUserJSONBuilder ¶
func NewUserJSONBuilder() *UserJSONBuilder
NewUserJSONBuilder make new UserJSONBuilder.
func (*UserJSONBuilder) Add ¶
func (b *UserJSONBuilder) Add(info *UserPropertyInfo) *UserJSONBuilder
Add specified property to UserJSONBuilder.
func (*UserJSONBuilder) AddAll ¶
func (b *UserJSONBuilder) AddAll() *UserJSONBuilder
AddAll adds all property to UserJSONBuilder.
func (*UserJSONBuilder) Convert ¶
func (b *UserJSONBuilder) Convert(orig *User) (*UserJSON, error)
Convert specified non-JSON object to JSON object.
func (*UserJSONBuilder) ConvertList ¶
func (b *UserJSONBuilder) ConvertList(orig []*User) (UserJSONList, error)
ConvertList specified non-JSON slice to JSONList.
func (*UserJSONBuilder) Marshal ¶
func (b *UserJSONBuilder) Marshal(orig *User) ([]byte, error)
Marshal non-JSON object to JSON string.
func (*UserJSONBuilder) Remove ¶
func (b *UserJSONBuilder) Remove(info *UserPropertyInfo) *UserJSONBuilder
Remove specified property to UserJSONBuilder.
type UserJSONList ¶
type UserJSONList []*UserJSON
UserJSONList is synonym about []*UserJSON.
func (UserJSONList) Convert ¶
func (jsonList UserJSONList) Convert() ([]*User, error)
Convert specified JSONList to non-JSON slice.
type UserPropertyDecoder ¶
UserPropertyDecoder is property decoder for [1]sJSON.
type UserPropertyEncoder ¶
UserPropertyEncoder is property encoder for [1]sJSON.
type UserPropertyInfo ¶
type UserPropertyInfo struct { Encoder UserPropertyEncoder Decoder UserPropertyDecoder // contains filtered or unexported fields }
UserPropertyInfo stores property information.
type UserQueryBuilder ¶
type UserQueryBuilder struct { ID *UserQueryProperty Name *UserQueryProperty MentorID *UserQueryProperty // contains filtered or unexported fields }
UserQueryBuilder build query for User.
func NewUserQueryBuilder ¶
func NewUserQueryBuilder(client datastore.Client) *UserQueryBuilder
NewUserQueryBuilder create new UserQueryBuilder.
func NewUserQueryBuilderWithKind ¶
func NewUserQueryBuilderWithKind(client datastore.Client, kind string) *UserQueryBuilder
NewUserQueryBuilderWithKind create new UserQueryBuilder with specific kind.
func (*UserQueryBuilder) Ancestor ¶
func (bldr *UserQueryBuilder) Ancestor(parentKey datastore.Key) *UserQueryBuilder
Ancestor sets parent key to ancestor query.
func (*UserQueryBuilder) KeysOnly ¶
func (bldr *UserQueryBuilder) KeysOnly() *UserQueryBuilder
KeysOnly sets keys only option to query.
func (*UserQueryBuilder) Limit ¶
func (bldr *UserQueryBuilder) Limit(limit int) *UserQueryBuilder
Limit setup to query.
func (*UserQueryBuilder) Offset ¶
func (bldr *UserQueryBuilder) Offset(offset int) *UserQueryBuilder
Offset setup to query.
func (*UserQueryBuilder) Query ¶
func (bldr *UserQueryBuilder) Query() datastore.Query
Query returns *datastore.Query.
func (*UserQueryBuilder) Start ¶
func (bldr *UserQueryBuilder) Start(cur datastore.Cursor) *UserQueryBuilder
Start setup to query.
type UserQueryProperty ¶
type UserQueryProperty struct {
// contains filtered or unexported fields
}
UserQueryProperty has property information for UserQueryBuilder.
func (*UserQueryProperty) Equal ¶
func (p *UserQueryProperty) Equal(value interface{}) *UserQueryBuilder
Equal filter with value.
func (*UserQueryProperty) Filter ¶
func (p *UserQueryProperty) Filter(op string, value interface{}) *UserQueryBuilder
Filter with op & value.
func (*UserQueryProperty) GreaterThan ¶
func (p *UserQueryProperty) GreaterThan(value interface{}) *UserQueryBuilder
GreaterThan filter with value.
func (*UserQueryProperty) GreaterThanOrEqual ¶
func (p *UserQueryProperty) GreaterThanOrEqual(value interface{}) *UserQueryBuilder
GreaterThanOrEqual filter with value.
func (*UserQueryProperty) LessThan ¶
func (p *UserQueryProperty) LessThan(value interface{}) *UserQueryBuilder
LessThan filter with value.
func (*UserQueryProperty) LessThanOrEqual ¶
func (p *UserQueryProperty) LessThanOrEqual(value interface{}) *UserQueryBuilder
LessThanOrEqual filter with value.