Documentation
¶
Overview ¶
This package is a helper for parsing http request from AngularJs application to GO api's I have developed
Index ¶
- Constants
- type NgGrid
- func (g *NgGrid) ExecuteSqlParameters(tx gorp.SqlExecutor, target interface{}, fields []string, pars []interface{}) (err error)
- func (g *NgGrid) FromRow() int64
- func (g *NgGrid) GenerateSql(tx gorp.SqlExecutor, fields []string) error
- func (g *NgGrid) GetPageNumber() int64
- func (g *NgGrid) GetPageSize() int64
- func (g *NgGrid) GetQuery() string
- func (g *NgGrid) Limit() int64
- func (g *NgGrid) Skip() int64
- func (g *NgGrid) ToRow() int64
Constants ¶
View Source
const ( QS_SORT_DIRECTION = "sortDirection" QS_SORT_FIELD = "sortField" QS_PAGE_NUMBER = "pageNumber" QS_PAGE_SIZE = "pageSize" QS_QUERY = "query" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NgGrid ¶
type NgGrid struct {
PageNumber int64 `json:"pageNumber"`
PageSize int64 `json:"pageSize"`
Query string `json:"query"`
SortDirection string `json:"sortDirection"`
SortField string `json:"sortField"`
TotalCount int64 `json:"totalCount"`
FilterCount int64 `json:"filterCount"`
Rows interface{} `json:"rows"`
GeneratedQuery string `json:"-"`
MainQuery string `json:"-"`
}
The main structure for parsing objects from json client
func ParseQueryString ¶
Parses a query string from url into NgGrid Useful when you are dealing with GET methods instead of POST and decoding
func (*NgGrid) ExecuteSqlParameters ¶
func (g *NgGrid) ExecuteSqlParameters(tx gorp.SqlExecutor, target interface{}, fields []string, pars []interface{}) (err error)
Executes sql statements along with its parameters
func (*NgGrid) GenerateSql ¶
func (g *NgGrid) GenerateSql(tx gorp.SqlExecutor, fields []string) error
Generates the sql and calculates the number of rows from the result query
Click to show internal directories.
Click to hide internal directories.