Documentation ¶
Overview ¶
Package clickhouse provides the ClickHouse backend provider
Index ¶
- Variables
- func LexerOptions() *lex.Options
- func NewClient(name string, o *bo.Options, router http.Handler, cache cache.Cache, ...) (backends.Backend, error)
- func SolveMathExpression(fieldParts token.Tokens, startValue int64, withVars token.Lookup) (int64, int, error)
- type Client
- func (c *Client) DefaultHealthCheckConfig() *ho.Options
- func (c *Client) DefaultPathConfigs(o *bo.Options) map[string]*po.Options
- func (c *Client) FastForwardRequest(r *http.Request) (*http.Request, error)
- func (c *Client) ParseTimeRangeQuery(r *http.Request) (*timeseries.TimeRangeQuery, *timeseries.RequestOptions, bool, error)
- func (c *Client) ProxyHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) QueryRangeHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) RegisterHandlers(map[string]http.Handler)
- func (c *Client) SetExtent(r *http.Request, trq *timeseries.TimeRangeQuery, extent *timeseries.Extent)
- func (c *Client) UnmarshalInstantaneous(data []byte) (timeseries.Timeseries, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidWithClause = errors.New("invalid WITH expression list")
ErrInvalidWithClause indicates the WITH clause of the query is not properly formatted
var ErrLimitUnsupported = errors.New("limit queries are not supported")
ErrLimitUnsupported indicates the input a LIMIT keyword, which is currently unsupported in the caching layer
var ErrNotAtPreWhere = errors.New("not at PREWHERE")
ErrNotAtPreWhere indicates AtPreWhere was called but the current token is not of type tokenPreWhere
var ErrUnsupportedOutputFormat = errors.New("unsupported output format requested")
ErrUnsupportedOutputFormat indicates the FORMAT value for the query is not supported
var ErrUnsupportedToStartOfFunc = errors.New("unsupported ToStartOf* func")
ErrUnsupportedToStartOfFunc indicates the ToStartOf func used in the query is not supported by Trickster
Functions ¶
func LexerOptions ¶
LexerOptions returns a Clickhouse-crafted Lexer Options Pointer
func NewClient ¶
func NewClient(name string, o *bo.Options, router http.Handler, cache cache.Cache, _ backends.Backends, _ types.Lookup) (backends.Backend, error)
NewClient returns a new Client Instance
func SolveMathExpression ¶
func SolveMathExpression(fieldParts token.Tokens, startValue int64, withVars token.Lookup) (int64, int, error)
SolveMathExpression will solve a rudimentary integer math expression in the format of: $int $plusOrMinus $int [$plusOrMinus $int ...] parenthesis and other complications are not supported, but 'now()' is translated into an int64 of epoch seconds. It will iterate the tokens until the end of the expression is reached by encountering a conditional, eof, or error token, or a token that does not conform to the format above. Since the first token has likely already been parsed to a number value in order to need to call SolveMathExpression, that startValue is passed here so as to avoid a reparse unless startValue is <= 0. the solved expression, the number of indexes in fieldParts advanced and the error state are returned
Types ¶
type Client ¶
type Client struct {
backends.TimeseriesBackend
}
Client Implements the Proxy Client Interface
func (*Client) DefaultHealthCheckConfig ¶
DefaultHealthCheckConfig returns the default HealthCheck Config for this backend provider
func (*Client) DefaultPathConfigs ¶
DefaultPathConfigs returns the default PathConfigs for the given Provider
func (*Client) FastForwardRequest ¶
FastForwardRequest is not used for ClickHouse and is here to conform to the Proxy Client interface
func (*Client) ParseTimeRangeQuery ¶
func (c *Client) ParseTimeRangeQuery(r *http.Request) (*timeseries.TimeRangeQuery, *timeseries.RequestOptions, bool, error)
ParseTimeRangeQuery parses the key parts of a TimeRangeQuery from the inbound HTTP Request
func (*Client) ProxyHandler ¶
func (c *Client) ProxyHandler(w http.ResponseWriter, r *http.Request)
ProxyHandler sends a request through the basic reverse proxy to the origin, and services non-cacheable ClickHouse API calls
func (*Client) QueryHandler ¶
func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request)
QueryHandler handles timeseries requests for ClickHouse and processes them through the delta proxy cache
func (*Client) QueryRangeHandler ¶
func (c *Client) QueryRangeHandler(w http.ResponseWriter, r *http.Request)
QueryRangeHandler is not used for ClickHouse and is here to conform to the Proxy Client interface
func (*Client) SetExtent ¶
func (c *Client) SetExtent(r *http.Request, trq *timeseries.TimeRangeQuery, extent *timeseries.Extent)
SetExtent will change the upstream request query to use the provided Extent
func (*Client) UnmarshalInstantaneous ¶
func (c *Client) UnmarshalInstantaneous(data []byte) (timeseries.Timeseries, error)
UnmarshalInstantaneous is not used for ClickHouse and is here to conform to the Proxy Client interface