Documentation ¶
Index ¶
- Constants
- type ESql
- func (e *ESql) Convert(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
- func (e *ESql) ConvertCadence(sql string, domainID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
- func (e *ESql) ConvertPretty(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
- func (e *ESql) ConvertPrettyCadence(sql string, domainID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
- func (e *ESql) ProcessQueryKey(filterArg FilterFunc, processArg ProcessFunc)
- func (e *ESql) ProcessQueryValue(filterArg FilterFunc, processArg ProcessFunc)
- func (e *ESql) SetBucketNum(bucketNumArg int)
- func (e *ESql) SetCadence(cadenceArg bool)
- func (e *ESql) SetPageSize(pageSizeArg int)
- type FilterFunc
- type ProcessFunc
Constants ¶
const ( DefaultPageSize = 1000 DefaultBucketNumber = 1000 ESDefaultMaxPageSize = 10000 TieBreaker = "RunID" RunID = "RunID" StartTime = "StartTime" DomainID = "DomainID" WorkflowID = "WorkflowID" ExecutionTime = "ExecutionTime" TieBreakerOrder = "desc" StartTimeOrder = "desc" )
default sizes and identifiers used in cadence visibility
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ESql ¶
type ESql struct {
// contains filtered or unexported fields
}
ESql ... ESql is used to hold necessary information that required in parsing
func (*ESql) Convert ¶
func (e *ESql) Convert(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
Convert ... Transform sql to elasticsearch dsl string
usage:
- dsl, sortField, err := e.Convert(sql, pageParam1, pageParam2, ...)
arguments:
- sql: the sql query needs conversion in string format
- pagination: variadic arguments that indicates es search_after
return values:
- dsl: the elasticsearch dsl json style string
- sortField: string array that contains all column names used for sorting. useful for pagination.
- err: contains err information
func (*ESql) ConvertCadence ¶
func (e *ESql) ConvertCadence(sql string, domainID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
ConvertCadence ... convert sql to es dsl, for cadence usage
func (*ESql) ConvertPretty ¶
func (e *ESql) ConvertPretty(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
ConvertPretty ... Transform sql to elasticsearch dsl, and prettify the output json
usage:
- dsl, sortField, err := e.ConvertPretty(sql, pageParam1, pageParam2, ...)
arguments:
- sql: the sql query needs conversion in string format
- pagination: variadic arguments that indicates es search_after for pagination
return values:
- dsl: the elasticsearch dsl json style string
- sortField: string array that contains all column names used for sorting. useful for pagination.
- err: contains err information
func (*ESql) ConvertPrettyCadence ¶
func (e *ESql) ConvertPrettyCadence(sql string, domainID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
ConvertPrettyCadence ... convert sql to es dsl, for cadence usage
func (*ESql) ProcessQueryKey ¶
func (e *ESql) ProcessQueryKey(filterArg FilterFunc, processArg ProcessFunc)
ProcessQueryKey ... set up user specified column name processing policy should not be called if there is potential race condition
func (*ESql) ProcessQueryValue ¶
func (e *ESql) ProcessQueryValue(filterArg FilterFunc, processArg ProcessFunc)
ProcessQueryValue ... set up user specified column value processing policy should not be called if there is potential race condition
func (*ESql) SetBucketNum ¶
SetBucketNum ... set the number of bucket returned in an aggregation query should not be called if there is potential race condition
func (*ESql) SetCadence ¶
SetCadence ... specify whether do special handling for cadence visibility should not be called if there is potential race condition should not be called by non-cadence user
func (*ESql) SetPageSize ¶
SetPageSize ... set the number of documents returned in a non-aggregation query should not be called if there is potential race condition
type FilterFunc ¶
FilterFunc ... esql use FilterFunc to determine whether a target is to be processed by ProcessFunc only those FilterFunc(colName) == true will be processed
type ProcessFunc ¶
ProcessFunc ... esql use ProcessFunc to process query key value macro