favcliptools

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestSuite = map[string]testsuite.Test{
	"FavclipTools": FavclipTools,
}

Functions

func FavclipTools

func FavclipTools(t *testing.T, ctx context.Context, client datastore.Client)

Types

type Plugger

type Plugger interface {
	Plugin() Plugin
}

Plugger supply Plugin component.

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 (id UserID) FromPropertyValue(ctx context.Context, p datastore.Property) (dst interface{}, err error)

func (UserID) MarshalJSON

func (id UserID) MarshalJSON() ([]byte, error)

func (UserID) ToPropertyValue

func (id UserID) ToPropertyValue(ctx context.Context) (interface{}, error)

func (*UserID) UnmarshalJSON

func (id *UserID) UnmarshalJSON(b []byte) error

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.

func (*UserJSON) Convert

func (orig *UserJSON) Convert() (*User, error)

Convert specified JSON object to non-JSON object.

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

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

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

type UserPropertyDecoder func(src *UserJSON, dest *User) error

UserPropertyDecoder is property decoder for [1]sJSON.

type UserPropertyEncoder

type UserPropertyEncoder func(src *User, dest *UserJSON) error

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

Start setup to query.

type UserQueryProperty

type UserQueryProperty struct {
	// contains filtered or unexported fields
}

UserQueryProperty has property information for UserQueryBuilder.

func (*UserQueryProperty) Asc

Asc order.

func (*UserQueryProperty) Desc

Desc order.

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.

Jump to

Keyboard shortcuts

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