This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
geoip_ffjson.go
88 lines (80 loc) · 1.54 KB
/
geoip_ffjson.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// DO NOT EDIT!
// Code generated by ffjson <https://github.com/pquerna/ffjson>
// source: geoip.go
// DO NOT EDIT!
package main
import (
fflib "github.com/pquerna/ffjson/fflib/v1"
)
func (mj *ResponseCity) MarshalJSON() ([]byte, error) {
var buf fflib.Buffer
buf.Grow(128)
err := mj.MarshalJSONBuf(&buf)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (mj *ResponseCity) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{ `)
if mj.Data != nil {
if true {
buf.WriteString(`"Data":`)
{
err = mj.Data.MarshalJSONBuf(buf)
if err != nil {
return err
}
}
buf.WriteByte(',')
}
}
if len(mj.Error) != 0 {
buf.WriteString(`"Error":`)
fflib.WriteJsonString(buf, string(mj.Error))
buf.WriteByte(',')
}
buf.Rewind(1)
buf.WriteByte('}')
return nil
}
func (mj *ResponseCountry) MarshalJSON() ([]byte, error) {
var buf fflib.Buffer
buf.Grow(128)
err := mj.MarshalJSONBuf(&buf)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (mj *ResponseCountry) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{ `)
if mj.Data != nil {
if true {
buf.WriteString(`"Data":`)
{
err = mj.Data.MarshalJSONBuf(buf)
if err != nil {
return err
}
}
buf.WriteByte(',')
}
}
if len(mj.Error) != 0 {
buf.WriteString(`"Error":`)
fflib.WriteJsonString(buf, string(mj.Error))
buf.WriteByte(',')
}
buf.Rewind(1)
buf.WriteByte('}')
return nil
}