suite

package
v0.0.0-...-5c22601 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSON_FILE_GEODATA = "../data/canada.json"
View Source
var JSON_FILE_LARGE = "../data/large.json"
View Source
var JSON_FILE_SMALL = "../data/small.json"

Functions

func BenchmarkSuite

func BenchmarkSuite(b *testing.B, newBenchmarker func() JSONBenchmarker)

BenchmarkSuite runs a suite of benchmark tests implemented by JSONBenchmarker against various datasets

func GenerateObjectFromFile

func GenerateObjectFromFile(filename string, result interface{})

func ReadFile

func ReadFile(filename string) []byte

Types

type GeoDataPayload

type GeoDataPayload struct {
	Type     string `json:"type"`
	Features []struct {
		Type       string `json:"type"`
		Properties struct {
			Name string `json:"name"`
		} `json:"properties"`
		Geometry struct {
			Type        string        `json:"type"`
			Coordinates [][][]float64 `json:"coordinates"`
		} `json:"geometry"`
	} `json:"features"`
}

func (GeoDataPayload) MarshalEasyJSON

func (v GeoDataPayload) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GeoDataPayload) MarshalJSON

func (v GeoDataPayload) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GeoDataPayload) UnmarshalEasyJSON

func (v *GeoDataPayload) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GeoDataPayload) UnmarshalJSON

func (v *GeoDataPayload) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type JSONBenchmarker

type JSONBenchmarker interface {
	Marshal(interface{}) ([]byte, error)
	Unmarshal([]byte, interface{}) error
}

JSONBenchmarker interface implements methods that are run for benchmarking within BenchmarkSuite

type LargePayload

type LargePayload struct {
	AreaNames                map[string]string `json:"areaNames"`
	AudienceSubCategoryNames map[string]string `json:"audienceSubCategoryNames"`
	Events                   map[string]struct {
		Description interface{} `json:"description"`
		ID          int         `json:"id"`
		Logo        interface{} `json:"logo"`
		Name        string      `json:"name"`
		SubTopicIds []int       `json:"subTopicIds"`
		SubjectCode interface{} `json:"subjectCode"`
		Subtitle    interface{} `json:"subtitle"`
		TopicIds    []int       `json:"topicIds"`
	} `json:"events"`
	Performances []struct {
		EventID int         `json:"eventId"`
		ID      int         `json:"id"`
		Logo    interface{} `json:"logo"`
		Name    interface{} `json:"name"`
		Prices  []struct {
			Amount                int `json:"amount"`
			AudienceSubCategoryID int `json:"audienceSubCategoryId"`
			SeatCategoryID        int `json:"seatCategoryId"`
		} `json:"prices"`
		SeatCategories []struct {
			Areas []struct {
				AreaID   int           `json:"areaId"`
				BlockIds []interface{} `json:"blockIds"`
			} `json:"areas"`
			SeatCategoryID int `json:"seatCategoryId"`
		} `json:"seatCategories"`
		SeatMapImage interface{} `json:"seatMapImage"`
		Start        int64       `json:"start"`
		VenueCode    string      `json:"venueCode"`
	} `json:"performances"`
	SeatCategoryNames map[string]string `json:"seatCategoryNames"`
	SubTopicNames     map[string]string `json:"subTopicNames"`
	TopicNames        map[string]string `json:"topicNames"`
	TopicSubTopics    map[string]string `json:"topicSubTopics"`
	VenueNames        map[string]string `json:"venueNames"`
}

func (LargePayload) MarshalEasyJSON

func (v LargePayload) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (LargePayload) MarshalJSON

func (v LargePayload) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*LargePayload) UnmarshalEasyJSON

func (v *LargePayload) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*LargePayload) UnmarshalJSON

func (v *LargePayload) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SmallPayload

type SmallPayload struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Public   string `json:"public"`
	Paginate struct {
		Default int `json:"default"`
		Max     int `json:"max"`
	} `json:"paginate"`
	Mongodb string `json:"mongodb"`
}

func (SmallPayload) MarshalEasyJSON

func (v SmallPayload) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SmallPayload) MarshalJSON

func (v SmallPayload) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SmallPayload) UnmarshalEasyJSON

func (v *SmallPayload) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SmallPayload) UnmarshalJSON

func (v *SmallPayload) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL