Documentation ¶
Index ¶
- type ObjectKeyFilterFn
- type Options
- type Parser
- type ParserPool
- type ParserPoolConfiguration
- type ParserPoolOptions
- func (o *ParserPoolOptions) InstrumentOptions() instrument.Options
- func (o *ParserPoolOptions) RefillHighWatermark() float64
- func (o *ParserPoolOptions) RefillLowWatermark() float64
- func (o *ParserPoolOptions) SetInstrumentOptions(v instrument.Options) *ParserPoolOptions
- func (o *ParserPoolOptions) SetRefillHighWatermark(v float64) *ParserPoolOptions
- func (o *ParserPoolOptions) SetRefillLowWatermark(v float64) *ParserPoolOptions
- func (o *ParserPoolOptions) SetSize(v int) *ParserPoolOptions
- func (o *ParserPoolOptions) Size() int
- type ParserPoolWatermarkConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectKeyFilterFn ¶
ObjectKeyFilterFn filters out values associated with keys matching the filter.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options provide a set of parsing options. TODO(xichen): limit the maximum capacity of each caching array via options. TODO(xichen): limit the maximum capacity of cached value arrays and KV arrays via options.
func (*Options) ObjectKeyFilterFn ¶
func (o *Options) ObjectKeyFilterFn() ObjectKeyFilterFn
ObjectKeyFilterFn returns the object key matching function.
func (*Options) SetMaxDepth ¶
SetMaxDepth sets the maximum depth eligible for parsing.
func (*Options) SetObjectKeyFilterFn ¶
func (o *Options) SetObjectKeyFilterFn(v ObjectKeyFilterFn) *Options
SetObjectKeyFilterFn sets the object key matching function.
type Parser ¶
type Parser interface { // Parse parses a JSON-encoded value and returns the parse result. // The value returned remains valid till the next Parse or ParseBytes call. Parse(str string) (*value.Value, error) // ParseBytes parses a byte slice and returns the parse result. // The value returned remains valid till the next Parse or ParseBytes call. ParseBytes(b []byte) (*value.Value, error) }
Parser parses JSON-encoded values.
type ParserPool ¶
type ParserPool struct {
// contains filtered or unexported fields
}
ParserPool is a value pool.
func NewParserPool ¶
func NewParserPool(opts *ParserPoolOptions) *ParserPool
NewParserPool creates a new pool.
type ParserPoolConfiguration ¶
type ParserPoolConfiguration struct { // The size of the pool. Size *int `yaml:"size"` // The watermark configuration. Watermark ParserPoolWatermarkConfiguration `yaml:"watermark"` }
ParserPoolConfiguration contains pool configuration.
func (*ParserPoolConfiguration) NewPoolOptions ¶
func (c *ParserPoolConfiguration) NewPoolOptions( instrumentOpts instrument.Options, ) *ParserPoolOptions
NewPoolOptions creates a new set of pool options.
type ParserPoolOptions ¶
type ParserPoolOptions struct {
// contains filtered or unexported fields
}
ParserPoolOptions provide a set of options for the value pool.
func NewParserPoolOptions ¶
func NewParserPoolOptions() *ParserPoolOptions
NewParserPoolOptions create a new set of value pool options.
func (*ParserPoolOptions) InstrumentOptions ¶
func (o *ParserPoolOptions) InstrumentOptions() instrument.Options
InstrumentOptions returns the instrument options.
func (*ParserPoolOptions) RefillHighWatermark ¶
func (o *ParserPoolOptions) RefillHighWatermark() float64
RefillHighWatermark returns the high watermark for stop refilling the pool.
func (*ParserPoolOptions) RefillLowWatermark ¶
func (o *ParserPoolOptions) RefillLowWatermark() float64
RefillLowWatermark returns the low watermark for refilling the pool.
func (*ParserPoolOptions) SetInstrumentOptions ¶
func (o *ParserPoolOptions) SetInstrumentOptions(v instrument.Options) *ParserPoolOptions
SetInstrumentOptions sets the instrument options.
func (*ParserPoolOptions) SetRefillHighWatermark ¶
func (o *ParserPoolOptions) SetRefillHighWatermark(v float64) *ParserPoolOptions
SetRefillHighWatermark sets the high watermark for refilling the pool.
func (*ParserPoolOptions) SetRefillLowWatermark ¶
func (o *ParserPoolOptions) SetRefillLowWatermark(v float64) *ParserPoolOptions
SetRefillLowWatermark sets the low watermark for refilling the pool.
func (*ParserPoolOptions) SetSize ¶
func (o *ParserPoolOptions) SetSize(v int) *ParserPoolOptions
SetSize sets the pool size.
type ParserPoolWatermarkConfiguration ¶
type ParserPoolWatermarkConfiguration struct { // The low watermark to start refilling the pool, if zero none. RefillLowWatermark float64 `yaml:"low" validate:"min=0.0,max=1.0"` // The high watermark to stop refilling the pool, if zero none. RefillHighWatermark float64 `yaml:"high" validate:"min=0.0,max=1.0"` }
ParserPoolWatermarkConfiguration contains watermark configuration for pools.