e

package
v0.0.0-...-a4a9cab Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

type Inventory struct {
	ParentKey   *datastore.Key `json:"-" datastore:"-" goon:"parent" search:"-"`
	ID          int64          `json:"-" datastore:"-" goon:"id" json:",string" search:",id"` // search:"id" もサポートしたい
	ProductName string
	Description string    `search:",ngram"`
	Stock       int       `search:",rank"`
	Price       int       `search:",string"`
	Barcode     int64     `search:",string"`
	AdminNames  []string  `search:",json"`
	Shops       []*Shop   `search:",json"`
	CreatedAt   time.Time `datastore:",noindex"`
	UpdatedAt   time.Time `datastore:",noindex" search:",unixtime"`
}

+smg

func (*Inventory) Searchfy

func (src *Inventory) Searchfy() (*InventorySearch, error)

Searchfy converts *Inventory to *InventorySearch.

type InventorySearch

type InventorySearch struct {
	ID                 string
	ProductName        string
	Description        string
	DescriptionUnigram string
	DescriptionBigram  string
	Stock              float64
	Price              string
	Barcode            string
	AdminNames         string
	Shops              string
	CreatedAt          time.Time
	UpdatedAt          time.Time
	UpdatedAtUnixTime  float64
	// contains filtered or unexported fields
}

InventorySearch best match Search API wrapper for Inventory.

func (*InventorySearch) DocID

func (doc *InventorySearch) DocID(c context.Context) (string, error)

func (*InventorySearch) Load

func (s *InventorySearch) Load(fields []search.Field, metadata *search.DocumentMetadata) error

Load by search.LoadStruct.

func (*InventorySearch) Save

Save with search.DocumentMetadata#Rank.

type InventorySearchBoolPropertyInfo

type InventorySearchBoolPropertyInfo struct {
	Name string
	// contains filtered or unexported fields
}

InventorySearchBoolPropertyInfo hold property info.

type InventorySearchBuilder

InventorySearchBuilder builds Search API query.

func NewInventorySearch

func NewInventorySearch() *InventorySearchBuilder

NewInventorySearch create new *InventorySearchBuilder.

func NewInventorySearchWithIndexName

func NewInventorySearchWithIndexName(name string) *InventorySearchBuilder

NewInventorySearchWithIndexName create new *InventorySearchBuilder with specified Index name. Should use with auto-fixed val like UserID, to avoid typo

func (*InventorySearchBuilder) And

And append new operant to query.

func (*InventorySearchBuilder) Delete

Delete document from Index.

func (*InventorySearchBuilder) DeleteByDocID

func (b *InventorySearchBuilder) DeleteByDocID(c context.Context, docID string) error

DeleteByDocID from Index.

func (*InventorySearchBuilder) DeleteDocument

func (b *InventorySearchBuilder) DeleteDocument(c context.Context, src *InventorySearch) error

DeleteDocument from Index.

func (*InventorySearchBuilder) DeleteDocumentMulti

func (b *InventorySearchBuilder) DeleteDocumentMulti(c context.Context, srcs []*InventorySearch) error

DeleteDocumentMulti from Index.

func (*InventorySearchBuilder) DeleteMulti

func (b *InventorySearchBuilder) DeleteMulti(c context.Context, srcs []*Inventory) error

DeleteMulti documents from Index.

func (*InventorySearchBuilder) DeleteMultiByDocIDs

func (b *InventorySearchBuilder) DeleteMultiByDocIDs(c context.Context, docIDs []string) error

DeleteMultiByDocIDs from Index.

func (*InventorySearchBuilder) EndGroup

EndGroup append new operant to query.

func (*InventorySearchBuilder) Group

func (b *InventorySearchBuilder) Group(p func()) *InventorySearchBuilder

Group append new operant to query.

func (*InventorySearchBuilder) IndexName

func (b *InventorySearchBuilder) IndexName() string

IndexName returns name of target index.

func (*InventorySearchBuilder) Opts

Opts returns *InventorySearchOptions.

func (*InventorySearchBuilder) Or

Or append new operant to query.

func (*InventorySearchBuilder) Put

Put document to Index.

func (*InventorySearchBuilder) PutDocument

PutDocument to Index

func (*InventorySearchBuilder) PutDocumentMulti

func (b *InventorySearchBuilder) PutDocumentMulti(c context.Context, srcs []*InventorySearch) ([]string, error)

PutDocumentMulti to Index.

func (*InventorySearchBuilder) PutMulti

func (b *InventorySearchBuilder) PutMulti(c context.Context, srcs []*Inventory) ([]string, error)

PutMulti documents to Index.

func (*InventorySearchBuilder) QueryString

func (b *InventorySearchBuilder) QueryString() (string, error)

QueryString returns query string.

func (*InventorySearchBuilder) Search

Search returns *InventorySearchIterator, It is result from Index.

func (*InventorySearchBuilder) SearchOptions

func (b *InventorySearchBuilder) SearchOptions() *search.SearchOptions

SearchOptions returns search options.

func (*InventorySearchBuilder) StartGroup

StartGroup append new operant to query.

type InventorySearchIterator

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

InventorySearchIterator can access to search result.

func (*InventorySearchIterator) Cursor

Cursor returns cursor of search.

func (*InventorySearchIterator) Next

Next returns next document from iter.

type InventorySearchNgramStringPropertyInfo

type InventorySearchNgramStringPropertyInfo struct {
	InventorySearchStringPropertyInfo
}

InventorySearchNgramStringPropertyInfo hold property info.

func (*InventorySearchNgramStringPropertyInfo) NgramMatch

NgramMatch add query operand.

type InventorySearchNumberPropertyInfo

type InventorySearchNumberPropertyInfo struct {
	Name string
	// contains filtered or unexported fields
}

InventorySearchNumberPropertyInfo hold property info.

func (*InventorySearchNumberPropertyInfo) Asc

Asc add query operand.

func (*InventorySearchNumberPropertyInfo) Desc

Desc add query operand.

func (*InventorySearchNumberPropertyInfo) Equal

Equal add query operand.

func (*InventorySearchNumberPropertyInfo) Int64Equal

Int64Equal add query operand.

func (*InventorySearchNumberPropertyInfo) Int64GreaterThan

Int64GreaterThan add query operand.

func (*InventorySearchNumberPropertyInfo) Int64GreaterThanOrEqual

func (p *InventorySearchNumberPropertyInfo) Int64GreaterThanOrEqual(value int64) *InventorySearchBuilder

Int64GreaterThanOrEqual add query operand.

func (*InventorySearchNumberPropertyInfo) Int64LessThan

Int64LessThan add query operand.

func (*InventorySearchNumberPropertyInfo) Int64LessThanOrEqual

func (p *InventorySearchNumberPropertyInfo) Int64LessThanOrEqual(value int64) *InventorySearchBuilder

Int64LessThanOrEqual add query operand.

func (*InventorySearchNumberPropertyInfo) IntEqual

IntEqual add query operand.

func (*InventorySearchNumberPropertyInfo) IntGreaterThan

IntGreaterThan add query operand.

func (*InventorySearchNumberPropertyInfo) IntGreaterThanOrEqual

func (p *InventorySearchNumberPropertyInfo) IntGreaterThanOrEqual(value int) *InventorySearchBuilder

IntGreaterThanOrEqual add query operand.

func (*InventorySearchNumberPropertyInfo) IntLessThan

IntLessThan add query operand.

func (*InventorySearchNumberPropertyInfo) IntLessThanOrEqual

func (p *InventorySearchNumberPropertyInfo) IntLessThanOrEqual(value int) *InventorySearchBuilder

IntLessThanOrEqual add query operand.

type InventorySearchOptions

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

InventorySearchOptions construct *search.SearchOptions.

func (*InventorySearchOptions) Cursor

Cursor setup opts.

func (*InventorySearchOptions) IDsOnly

IDsOnly setup opts.

func (*InventorySearchOptions) Limit

Limit setup opts.

func (*InventorySearchOptions) Offset

Offset setup opts.

type InventorySearchStringPropertyInfo

type InventorySearchStringPropertyInfo struct {
	Name string
	// contains filtered or unexported fields
}

InventorySearchStringPropertyInfo hold property info.

func (*InventorySearchStringPropertyInfo) Asc

Asc add query operand.

func (*InventorySearchStringPropertyInfo) Desc

Desc add query operand.

func (*InventorySearchStringPropertyInfo) Match

Match add query operand.

type InventorySearchTimePropertyInfo

type InventorySearchTimePropertyInfo struct {
	Name string
	// contains filtered or unexported fields
}

InventorySearchTimePropertyInfo hold property info.

func (*InventorySearchTimePropertyInfo) Asc

Asc add query operand.

func (*InventorySearchTimePropertyInfo) Desc

Desc add query operand.

func (*InventorySearchTimePropertyInfo) Equal

Equal add query operand.

func (*InventorySearchTimePropertyInfo) GreaterThan

GreaterThan add query operand.

func (*InventorySearchTimePropertyInfo) GreaterThanOrEqual

func (p *InventorySearchTimePropertyInfo) GreaterThanOrEqual(value time.Time) *InventorySearchBuilder

GreaterThanOrEqual add query operand.

func (*InventorySearchTimePropertyInfo) LessThan

LessThan add query operand.

func (*InventorySearchTimePropertyInfo) LessThanOrEqual

LessThanOrEqual add query operand.

type InventorySearchUnixTimePropertyInfo

type InventorySearchUnixTimePropertyInfo struct {
	Name string
	// contains filtered or unexported fields
}

InventorySearchUnixTimePropertyInfo hold property info.

func (*InventorySearchUnixTimePropertyInfo) Asc

Asc add query operand.

func (*InventorySearchUnixTimePropertyInfo) Desc

Desc add query operand.

func (*InventorySearchUnixTimePropertyInfo) Equal

Equal add query operand.

func (*InventorySearchUnixTimePropertyInfo) GreaterThan

GreaterThan add query operand.

func (*InventorySearchUnixTimePropertyInfo) GreaterThanOrEqual

GreaterThanOrEqual add query operand.

func (*InventorySearchUnixTimePropertyInfo) LessThan

LessThan add query operand.

func (*InventorySearchUnixTimePropertyInfo) LessThanOrEqual

LessThanOrEqual add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeAsc

UnixTimeAsc add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeDesc

UnixTimeDesc add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeEqual

UnixTimeEqual add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeGreaterThan

UnixTimeGreaterThan add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeGreaterThanOrEqual

func (p *InventorySearchUnixTimePropertyInfo) UnixTimeGreaterThanOrEqual(value time.Time) *InventorySearchBuilder

UnixTimeGreaterThanOrEqual add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeLessThan

UnixTimeLessThan add query operand.

func (*InventorySearchUnixTimePropertyInfo) UnixTimeLessThanOrEqual

func (p *InventorySearchUnixTimePropertyInfo) UnixTimeLessThanOrEqual(value time.Time) *InventorySearchBuilder

UnixTimeLessThanOrEqual add query operand.

type Shop

type Shop struct {
	Name    string
	Address string
}

Jump to

Keyboard shortcuts

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