structs

package
v0.0.0-...-82e36bc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntries

type CacheEntries []*CacheEntry

func (CacheEntries) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (CacheEntries) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*CacheEntries) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CacheEntries) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type CacheEntry

type CacheEntry struct {
	IP       string       `json:"query"`
	Lang     string       `json:"lang"`
	Fields   field.Fields `json:"fields"`
	Expires  time.Time    `json:"-"`
	Response Response     `json:"-"`
}

func (CacheEntry) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (CacheEntry) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*CacheEntry) Size

func (c *CacheEntry) Size() int

Size returns the size of the CacheEntry in bytes.

func (*CacheEntry) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CacheEntry) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Response

type Response struct {
	Status        *string  `json:"status,omitempty"`        // "success"
	Continent     *string  `json:"continent,omitempty"`     // "North America"
	ContinentCode *string  `json:"continentCode,omitempty"` // "NA"
	Country       *string  `json:"country,omitempty"`       // "Canada"
	CountryCode   *string  `json:"countryCode,omitempty"`   // "CA"
	Region        *string  `json:"region,omitempty"`        // "QC"
	RegionName    *string  `json:"regionName,omitempty"`    // "Quebec"
	City          *string  `json:"city,omitempty"`          // "Montreal"
	District      *string  `json:"district,omitempty"`      // """"
	Zip           *string  `json:"zip,omitempty"`           // "H1S"
	Lat           *float64 `json:"lat,omitempty"`           // 45.5808
	Lon           *float64 `json:"lon,omitempty"`           // -73.5825
	Timezone      *string  `json:"timezone,omitempty"`      // "America/Toronto"
	Offset        *int     `json:"offset,omitempty"`        // -14400
	Currency      *string  `json:"currency,omitempty"`      // "CAD"
	ISP           *string  `json:"isp,omitempty"`           // "Le Groupe Videotron Ltee"
	Org           *string  `json:"org,omitempty"`           // "Videotron Ltee"
	AS            *string  `json:"as,omitempty"`            // "AS5769 Videotron Telecom Ltee"
	ASName        *string  `json:"asname,omitempty"`        // "VIDEOTRON"
	Reverse       *string  `json:"reverse,omitempty"`       // "modemcable001.0-48-24.mc.videotron.ca"
	Mobile        *bool    `json:"mobile,omitempty"`        // false
	Proxy         *bool    `json:"proxy,omitempty"`         // false
	Hosting       *bool    `json:"hosting,omitempty"`       // false
	Message       *string  `json:"message,omitempty"`       // "invalid query"
	Query         *string  `json:"query,omitempty"`         // "24.48.0.1"
}

func ErrorResponse

func ErrorResponse(status, message string) Response

func (Response) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (Response) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (Response) Trim

func (r Response) Trim(fields field.Fields) Response

func (*Response) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Response) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Responses

type Responses []Response

func (Responses) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (Responses) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*Responses) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Responses) UnmarshalJSON

func (v *Responses) 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