Documentation ¶
Index ¶
- func Fixed32Encode(x uint32) []byte
- func Fixed64Encode(x uint64) []byte
- func ProtobufWriteDouble(w io.Writer, value float64)
- func ProtobufWriteDoubleN(w io.Writer, value float64, n int)
- func ProtobufWriteSingle(w io.Writer, value float32)
- func VarintEncode(x uint64) []byte
- func VarintLen(x uint64) uint64
- func VarintWrite(w io.Writer, x uint64)
- func WriteByteN(w *bufio.Writer, value byte, n int)
- type Formatter
- type JSON
- type Pickle
- type V2PB
- type V3PB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fixed32Encode ¶
func Fixed64Encode ¶
func ProtobufWriteDouble ¶
func ProtobufWriteSingle ¶
func VarintEncode ¶
func VarintWrite ¶
Types ¶
type Formatter ¶
type Formatter interface { // Parse request ParseRequest(r *http.Request) (data.MultiTarget, error) // Generate reply payload Reply(http.ResponseWriter, *http.Request, data.CHResponses) }
Formatter implements request parser and response generator
type JSON ¶
type JSON struct{}
JSON is an implementation of carbonapi_v3_pb MultiGlobRequest and MultiFetchResponse interconnection. It accepts the normal forms parser of `Content-Type: application/json` POST requests with JSON representation of MultiGlobRequest.
func (*JSON) ParseRequest ¶
ParseRequest first tries to get body for application/json and convert it to carbonapi_v3_pb.MultiFetchRequest. As a fail-over it parses request forms.
func (*JSON) Reply ¶
func (*JSON) Reply(w http.ResponseWriter, r *http.Request, multiData data.CHResponses)
Reply response to request with JSON representation of carbonapi_v3_pb.MultiFetchResponse.
type Pickle ¶
type Pickle struct{}
Pickle is a formatter for python object serialization format.
func (*Pickle) ParseRequest ¶
ParseRequest parses target/from/until/maxDataPoints URL forms values
func (*Pickle) Reply ¶
func (*Pickle) Reply(w http.ResponseWriter, r *http.Request, multiData data.CHResponses)
Reply serializes ClickHouse response to pickle format
type V2PB ¶
type V2PB struct {
// contains filtered or unexported fields
}
V2PB is a formatter for carbonapi_v2_pb
func (*V2PB) ParseRequest ¶
ParseRequest parses target/from/until/maxDataPoints URL forms values
func (*V2PB) Reply ¶
func (v *V2PB) Reply(w http.ResponseWriter, r *http.Request, multiData data.CHResponses)
Reply serializes ClickHouse response to carbonapi_v2_pb.MultiFetchResponse format
type V3PB ¶
type V3PB struct {
// contains filtered or unexported fields
}
V3PB is a formatter for carbonapi_v3_pb
func (*V3PB) ParseRequest ¶
ParseRequest reads the requests parameters from carbonapi_v3_pb.MultiFetchRequest
func (*V3PB) Reply ¶
func (v *V3PB) Reply(w http.ResponseWriter, r *http.Request, multiData data.CHResponses)
Reply serializes ClickHouse response to carbonapi_v3_pb.MultiFetchResponse format