Documentation ¶
Index ¶
- Constants
- func Parse(filename string, b []byte, opts ...Option) (interface{}, error)
- func ParseFile(filename string, opts ...Option) (interface{}, error)
- func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error)
- type NodeFilter
- type NodeFilterById
- type Option
- type QueryParams
Constants ¶
const FORMAT_ERROR_LOCATION_FILTER = "%v filter for provinces:%v and cities:%v are both set"
Checks the parameters
1. provinces and cities cannot be assigned at the same time(except auto-condition) 2. duplicated value would be eliminated
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NodeFilter ¶
The filter of node
type NodeFilterById ¶
type NodeFilterById struct { MatchIds []int32 MatchProvinces []int16 MatchCities []int16 MatchIsps []int16 }
The filter of node
type Option ¶
type Option func(*parser) Option
Option is a function that can set an option on the parser. It returns the previous setting as an Option.
func Debug ¶
Debug creates an Option to set the debug flag to b. When set to true, debugging information is printed to stdout while parsing.
The default is false.
func Memoize ¶
Memoize creates an Option to set the memoize flag to b. When set to true, the parser will cache all results so each expression is evaluated only once. This guarantees linear parsing time even for pathological cases, at the expense of more memory and slower times for typical cases.
The default is false.
type QueryParams ¶
type QueryParams struct { StartTime time.Time EndTime time.Time AgentFilter NodeFilter TargetFilter NodeFilter AgentFilterById NodeFilterById TargetFilterById NodeFilterById IspRelation model.PropRelation ProvinceRelation model.PropRelation CityRelation model.PropRelation }
The parameters for query
func NewQueryParams ¶
func NewQueryParams() *QueryParams
Initialize query parameters with default values
func (*QueryParams) CheckRationalOfParameters ¶
func (p *QueryParams) CheckRationalOfParameters() error
*
- Checks:
- 1. The end time must be after or equals the start time
func (*QueryParams) SetUpParams ¶
func (p *QueryParams) SetUpParams(paramSetters interface{})
Sets-up the parameters