Documentation ¶
Index ¶
- func GzipCompress(w http.ResponseWriter) (http.ResponseWriter, func() error)
- func OptionEquals(opt1, opt2 *Option) bool
- func TestCandidateChannelHandleFunc(t *testing.T, c CandidateChannelHandlerFunc)
- func TestCandidateHandleFunc(t *testing.T, c CandidateHandlerFunc)
- func TestCandidateHandleFunc_Gzip(t *testing.T, c CandidateHandlerFunc)
- type CandidateChannelHandlerFunc
- type CandidateHandlerFunc
- type Logger
- type Option
- type OptionsGen
- type ResolveScale
- type Response
- type SearchGraphQLRequester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GzipCompress ¶
func GzipCompress(w http.ResponseWriter) (http.ResponseWriter, func() error)
func OptionEquals ¶
func TestCandidateChannelHandleFunc ¶
func TestCandidateChannelHandleFunc(t *testing.T, c CandidateChannelHandlerFunc)
func TestCandidateHandleFunc ¶
func TestCandidateHandleFunc(t *testing.T, c CandidateHandlerFunc)
TestCandidateHandleFunc tests that a candidate encodes options correctly
func TestCandidateHandleFunc_Gzip ¶
func TestCandidateHandleFunc_Gzip(t *testing.T, c CandidateHandlerFunc)
Types ¶
type CandidateChannelHandlerFunc ¶
type CandidateChannelHandlerFunc interface { CandidateHandlerFunc ChannelHandlerFunc(options <-chan *Option) (http.HandlerFunc, error) }
type CandidateHandlerFunc ¶
type CandidateHandlerFunc interface { // HandlerFunc returned must write the given options in the response body HandlerFunc(options []*Option) (http.HandlerFunc, error) // UnmarshalOptions must take the bytes of a responseBody and unmarshal them to Options UnmarshalOptions([]byte) ([]*Option, error) }
CandidateHandlerFunc is the interface used to benchmark
type Logger ¶
type Logger interface {
Info(string)
}
func NewStdoutLogger ¶
func NewStdoutLogger() Logger
type Option ¶
type Option domainHotelCommon.Option
easyjson:json
func JSONUnmarshalOptions ¶
JSONUnmarshalOptions is a valid UnmarshalOptions func for those implementations that write a JSON encoded 'Response' in the response body
func (Option) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Option) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Option) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Option) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OptionsGen ¶
func NewOptionsGen ¶
func NewOptionsGen() OptionsGen
type ResolveScale ¶
type ResolveScale string
ResolveScale of fields in the graph Request low: options with 1 field medium: options with half the fields high: options with all the fields
const ( ResolveScaleLow ResolveScale = "low" ResolveScaleMedium ResolveScale = "medium" ResolveScaleHigh ResolveScale = "high" )
type Response ¶
type Response struct { Data struct { HotelX struct { Search struct { Options []*Option `json:"options"` Errors struct { Code string `json:"code"` Type string `json:"type"` Description string `json:"description"` } `json:"errors"` } `json:"search"` } `json:"hotelX"` } `json:"data"` }
to generate a new file for EasyJson: https://github.com/mailru/easyjson: go run $GOPATH/src/github.com/mailru/easyjson/easyjson/main.go -all $GOPATH/src/github.com/travelgateX/presenters-benchmark/pkg/presenter/option.go
easyjson:json
func (Response) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Response) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Response) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Response) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type SearchGraphQLRequester ¶
type SearchGraphQLRequester interface {
SearchGraphQLRequest(ResolveScale) []byte
}
SearchGraphQLRequester creates a valid Search service request compliant with the schema, ResolveScale is an indicator of the number of option's fields requested
func NewSearchGraphQLRequester ¶
func NewSearchGraphQLRequester() SearchGraphQLRequester
Directories ¶
Path | Synopsis |
---|---|
Code generated by easyjson for marshaling/unmarshaling.
|
Code generated by easyjson for marshaling/unmarshaling. |