datastore: go.mercari.io/datastore/testsuite/favcliptools Index | Files

package favcliptools

import "go.mercari.io/datastore/testsuite/favcliptools"

Index

Package Files

main.go model_json.go model_query.go

Variables

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

TestSuite contains all the test cases that this package provides.

type Plugger Uses

type Plugger interface {
    Plugin() Plugin
}

Plugger supply Plugin component.

type Plugin Uses

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 Uses

type User struct {
    ID       userID `datastore:"-" boom:"id" json:"id"`
    Name     string `json:"name"`
    MentorID userID `json:"mentorID"`
}

User kind +jwg +qbg

type UserJSON Uses

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 Uses

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

Convert specified JSON object to non-JSON object.

type UserJSONBuilder Uses

type UserJSONBuilder struct {
    ID       *UserPropertyInfo
    Name     *UserPropertyInfo
    MentorID *UserPropertyInfo
    // contains filtered or unexported fields
}

UserJSONBuilder convert between User to UserJSON mutually.

func NewUserJSONBuilder Uses

func NewUserJSONBuilder() *UserJSONBuilder

NewUserJSONBuilder make new UserJSONBuilder.

func (*UserJSONBuilder) Add Uses

func (b *UserJSONBuilder) Add(infos ...*UserPropertyInfo) *UserJSONBuilder

Add specified property to UserJSONBuilder.

func (*UserJSONBuilder) AddAll Uses

func (b *UserJSONBuilder) AddAll() *UserJSONBuilder

AddAll adds all property to UserJSONBuilder.

func (*UserJSONBuilder) AddByJSONNames Uses

func (b *UserJSONBuilder) AddByJSONNames(names ...string) *UserJSONBuilder

AddByJSONNames add properties to UserJSONBuilder by JSON property name. if name is not in the builder, it will ignore.

func (*UserJSONBuilder) AddByNames Uses

func (b *UserJSONBuilder) AddByNames(names ...string) *UserJSONBuilder

AddByNames add properties to UserJSONBuilder by struct property name. if name is not in the builder, it will ignore.

func (*UserJSONBuilder) Convert Uses

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

Convert specified non-JSON object to JSON object.

func (*UserJSONBuilder) ConvertList Uses

func (b *UserJSONBuilder) ConvertList(orig []*User) (UserJSONList, error)

ConvertList specified non-JSON slice to JSONList.

func (*UserJSONBuilder) Marshal Uses

func (b *UserJSONBuilder) Marshal(orig *User) ([]byte, error)

Marshal non-JSON object to JSON string.

func (*UserJSONBuilder) Properties Uses

func (b *UserJSONBuilder) Properties() []*UserPropertyInfo

Properties returns all properties on UserJSONBuilder.

func (*UserJSONBuilder) Remove Uses

func (b *UserJSONBuilder) Remove(infos ...*UserPropertyInfo) *UserJSONBuilder

Remove specified property to UserJSONBuilder.

func (*UserJSONBuilder) RemoveByJSONNames Uses

func (b *UserJSONBuilder) RemoveByJSONNames(names ...string) *UserJSONBuilder

RemoveByJSONNames remove properties to UserJSONBuilder by JSON property name. if name is not in the builder, it will ignore.

func (*UserJSONBuilder) RemoveByNames Uses

func (b *UserJSONBuilder) RemoveByNames(names ...string) *UserJSONBuilder

RemoveByNames remove properties to UserJSONBuilder by struct property name. if name is not in the builder, it will ignore.

type UserJSONList Uses

type UserJSONList []*UserJSON

UserJSONList is synonym about []*UserJSON.

func (UserJSONList) Convert Uses

func (jsonList UserJSONList) Convert() ([]*User, error)

Convert specified JSONList to non-JSON slice.

type UserPropertyDecoder Uses

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

UserPropertyDecoder is property decoder for [1]sJSON.

type UserPropertyEncoder Uses

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

UserPropertyEncoder is property encoder for [1]sJSON.

type UserPropertyInfo Uses

type UserPropertyInfo struct {
    Encoder UserPropertyEncoder
    Decoder UserPropertyDecoder
    // contains filtered or unexported fields
}

UserPropertyInfo stores property information.

func (*UserPropertyInfo) FieldName Uses

func (info *UserPropertyInfo) FieldName() string

FieldName returns struct field name of property.

func (*UserPropertyInfo) JSONName Uses

func (info *UserPropertyInfo) JSONName() string

JSONName returns json field name of property.

type UserQueryBuilder Uses

type UserQueryBuilder struct {
    ID       *UserQueryProperty
    Name     *UserQueryProperty
    MentorID *UserQueryProperty
    // contains filtered or unexported fields
}

UserQueryBuilder build query for User.

func NewUserQueryBuilder Uses

func NewUserQueryBuilder(client datastore.Client) *UserQueryBuilder

NewUserQueryBuilder create new UserQueryBuilder.

func NewUserQueryBuilderWithKind Uses

func NewUserQueryBuilderWithKind(client datastore.Client, kind string) *UserQueryBuilder

NewUserQueryBuilderWithKind create new UserQueryBuilder with specific kind.

func (*UserQueryBuilder) Ancestor Uses

func (bldr *UserQueryBuilder) Ancestor(parentKey datastore.Key) *UserQueryBuilder

Ancestor sets parent key to ancestor query.

func (*UserQueryBuilder) KeysOnly Uses

func (bldr *UserQueryBuilder) KeysOnly() *UserQueryBuilder

KeysOnly sets keys only option to query.

func (*UserQueryBuilder) Limit Uses

func (bldr *UserQueryBuilder) Limit(limit int) *UserQueryBuilder

Limit setup to query.

func (*UserQueryBuilder) Offset Uses

func (bldr *UserQueryBuilder) Offset(offset int) *UserQueryBuilder

Offset setup to query.

func (*UserQueryBuilder) Query Uses

func (bldr *UserQueryBuilder) Query() datastore.Query

Query returns *datastore.Query.

func (*UserQueryBuilder) Start Uses

func (bldr *UserQueryBuilder) Start(cur datastore.Cursor) *UserQueryBuilder

Start setup to query.

type UserQueryProperty Uses

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

UserQueryProperty has property information for UserQueryBuilder.

func (*UserQueryProperty) Asc Uses

func (p *UserQueryProperty) Asc() *UserQueryBuilder

Asc order.

func (*UserQueryProperty) Desc Uses

func (p *UserQueryProperty) Desc() *UserQueryBuilder

Desc order.

func (*UserQueryProperty) Equal Uses

func (p *UserQueryProperty) Equal(value interface{}) *UserQueryBuilder

Equal filter with value.

func (*UserQueryProperty) Filter Uses

func (p *UserQueryProperty) Filter(op string, value interface{}) *UserQueryBuilder

Filter with op & value.

func (*UserQueryProperty) GreaterThan Uses

func (p *UserQueryProperty) GreaterThan(value interface{}) *UserQueryBuilder

GreaterThan filter with value.

func (*UserQueryProperty) GreaterThanOrEqual Uses

func (p *UserQueryProperty) GreaterThanOrEqual(value interface{}) *UserQueryBuilder

GreaterThanOrEqual filter with value.

func (*UserQueryProperty) LessThan Uses

func (p *UserQueryProperty) LessThan(value interface{}) *UserQueryBuilder

LessThan filter with value.

func (*UserQueryProperty) LessThanOrEqual Uses

func (p *UserQueryProperty) LessThanOrEqual(value interface{}) *UserQueryBuilder

LessThanOrEqual filter with value.

Package favcliptools imports 7 packages (graph). Updated 2019-03-20. Refresh now. Tools for package owners.