Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidInput = errors.New("invalid input") ErrInternalError = errors.New("server or network error") )
Functions ¶
This section is empty.
Types ¶
type EntityList ¶
type EntityList struct {
*Page
Type EntityType
IsSearch bool
Keyword string
TotalCount int64
PageCount int64
PageTotal int64
PageCurrent int64
PageNext *Pagination
PagePrev *Pagination
Filter Filter
List interface{}
}
func (*EntityList) GetPagination ¶
func (l *EntityList) GetPagination() error
type EntityPage ¶
type EntityPage struct {
*Page
Entity interface{}
}
type EntityType ¶
type EntityType int
const ( TypeItem EntityType = iota TypeLocation TypeMixed )
func (EntityType) String ¶
func (et EntityType) String() string
type Page ¶
func CreatePage ¶
func (*Page) Entity ¶
func (p *Page) Entity(e interface{}) *EntityPage
type Pagination ¶
type Response ¶
type Response struct {
Status string `json:"status"`
Message string `json:"message"`
StatusCode int `json:"code"`
}
Response describes a JSON status response
func NewResponse ¶
NewResponse creates a new JSON status response based on parameters
type SearchFilter ¶
type SearchOperation ¶
type SearchOperation struct {
Term string
Filter *SearchFilter
Limit int
Results chan []*SearchResult
Error error
Tasks sync.WaitGroup
sync.RWMutex
}
func NewSearch ¶
func NewSearch(term string, filter *SearchFilter, limit int) *SearchOperation
func (*SearchOperation) Close ¶
func (so *SearchOperation) Close()
func (*SearchOperation) Items ¶
func (so *SearchOperation) Items()
func (*SearchOperation) Locations ¶
func (so *SearchOperation) Locations()
type SearchResult ¶
type SearchResult struct {
ID string `json:"id"`
Name string `json:"name"`
ShortName string `json:"shortName,omitempty"`
Parent string `json:"parent,omitempty"`
Type EntityType `json:"type"`
}
Click to show internal directories.
Click to hide internal directories.