summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mailru/easyjson/opt
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-01-29 14:17:40 -0800
committerGitHub <noreply@github.com>2018-01-29 14:17:40 -0800
commit961c04cae992eadb42d286d2f85f8a675bdc68c8 (patch)
tree3408f2d06f847e966c53485e2d54c692cdd037c1 /vendor/github.com/mailru/easyjson/opt
parent8d66523ba7d9a77129844be476732ebfd5272d64 (diff)
downloadchat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.gz
chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.bz2
chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.zip
Upgrading server dependancies (#8154)
Diffstat (limited to 'vendor/github.com/mailru/easyjson/opt')
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_String.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go79
-rw-r--r--vendor/github.com/mailru/easyjson/opt/optional/opt.go80
-rw-r--r--vendor/github.com/mailru/easyjson/opt/opts.go22
16 files changed, 1208 insertions, 0 deletions
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go
new file mode 100644
index 000000000..6978ee971
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Bool struct {
+ V bool
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OBool(v bool) Bool {
+ return Bool{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Bool) Get(deflt bool) bool {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Bool) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Bool(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Bool) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Bool{}
+ } else {
+ v.V = l.Bool()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Bool) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Bool) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Bool) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Bool) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go
new file mode 100644
index 000000000..643cea359
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Float32 struct {
+ V float32
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OFloat32(v float32) Float32 {
+ return Float32{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Float32) Get(deflt float32) float32 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Float32) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Float32(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Float32) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Float32{}
+ } else {
+ v.V = l.Float32()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Float32) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Float32) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Float32) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Float32) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go
new file mode 100644
index 000000000..75ae72757
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Float64 struct {
+ V float64
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OFloat64(v float64) Float64 {
+ return Float64{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Float64) Get(deflt float64) float64 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Float64) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Float64(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Float64) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Float64{}
+ } else {
+ v.V = l.Float64()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Float64) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Float64) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Float64) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Float64) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go
new file mode 100644
index 000000000..469742fee
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Int struct {
+ V int
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OInt(v int) Int {
+ return Int{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Int) Get(deflt int) int {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Int) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Int(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Int) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Int{}
+ } else {
+ v.V = l.Int()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Int) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Int) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Int) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Int) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go
new file mode 100644
index 000000000..b7723e241
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Int16 struct {
+ V int16
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OInt16(v int16) Int16 {
+ return Int16{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Int16) Get(deflt int16) int16 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Int16) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Int16(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Int16) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Int16{}
+ } else {
+ v.V = l.Int16()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Int16) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Int16) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Int16) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Int16) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go
new file mode 100644
index 000000000..7c7637a38
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Int32 struct {
+ V int32
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OInt32(v int32) Int32 {
+ return Int32{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Int32) Get(deflt int32) int32 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Int32) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Int32(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Int32) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Int32{}
+ } else {
+ v.V = l.Int32()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Int32) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Int32) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Int32) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Int32) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go
new file mode 100644
index 000000000..e6ea6dc41
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Int64 struct {
+ V int64
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OInt64(v int64) Int64 {
+ return Int64{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Int64) Get(deflt int64) int64 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Int64) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Int64(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Int64) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Int64{}
+ } else {
+ v.V = l.Int64()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Int64) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Int64) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Int64) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Int64) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go
new file mode 100644
index 000000000..ddc666580
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Int8 struct {
+ V int8
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OInt8(v int8) Int8 {
+ return Int8{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Int8) Get(deflt int8) int8 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Int8) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Int8(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Int8) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Int8{}
+ } else {
+ v.V = l.Int8()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Int8) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Int8) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Int8) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Int8) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go
new file mode 100644
index 000000000..11c90b4ed
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type String struct {
+ V string
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OString(v string) String {
+ return String{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v String) Get(deflt string) string {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v String) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.String(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *String) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = String{}
+ } else {
+ v.V = l.String()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v String) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *String) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v String) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v String) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go
new file mode 100644
index 000000000..57efd3185
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Uint struct {
+ V uint
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OUint(v uint) Uint {
+ return Uint{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Uint) Get(deflt uint) uint {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Uint) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Uint(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Uint) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Uint{}
+ } else {
+ v.V = l.Uint()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Uint) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Uint) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Uint) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Uint) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go
new file mode 100644
index 000000000..f28e1d2ef
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Uint16 struct {
+ V uint16
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OUint16(v uint16) Uint16 {
+ return Uint16{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Uint16) Get(deflt uint16) uint16 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Uint16) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Uint16(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Uint16) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Uint16{}
+ } else {
+ v.V = l.Uint16()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Uint16) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Uint16) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Uint16) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Uint16) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go
new file mode 100644
index 000000000..9fb95c0db
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Uint32 struct {
+ V uint32
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OUint32(v uint32) Uint32 {
+ return Uint32{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Uint32) Get(deflt uint32) uint32 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Uint32) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Uint32(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Uint32) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Uint32{}
+ } else {
+ v.V = l.Uint32()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Uint32) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Uint32) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Uint32) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Uint32) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go
new file mode 100644
index 000000000..0e623c62d
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Uint64 struct {
+ V uint64
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OUint64(v uint64) Uint64 {
+ return Uint64{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Uint64) Get(deflt uint64) uint64 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Uint64) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Uint64(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Uint64) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Uint64{}
+ } else {
+ v.V = l.Uint64()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Uint64) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Uint64) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Uint64) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Uint64) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go
new file mode 100644
index 000000000..c629e4453
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go
@@ -0,0 +1,79 @@
+// generated by gotemplate
+
+package opt
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Uint8 struct {
+ V uint8
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OUint8(v uint8) Uint8 {
+ return Uint8{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Uint8) Get(deflt uint8) uint8 {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Uint8) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Uint8(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Uint8) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Uint8{}
+ } else {
+ v.V = l.Uint8()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Uint8) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Uint8) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Uint8) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Uint8) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/optional/opt.go b/vendor/github.com/mailru/easyjson/opt/optional/opt.go
new file mode 100644
index 000000000..277dd1a3b
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/optional/opt.go
@@ -0,0 +1,80 @@
+// +build none
+
+package optional
+
+import (
+ "fmt"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// template type Optional(A)
+type A int
+
+// A 'gotemplate'-based type for providing optional semantics without using pointers.
+type Optional struct {
+ V A
+ Defined bool
+}
+
+// Creates an optional type with a given value.
+func OOptional(v A) Optional {
+ return Optional{V: v, Defined: true}
+}
+
+// Get returns the value or given default in the case the value is undefined.
+func (v Optional) Get(deflt A) A {
+ if !v.Defined {
+ return deflt
+ }
+ return v.V
+}
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v Optional) MarshalEasyJSON(w *jwriter.Writer) {
+ if v.Defined {
+ w.Optional(v.V)
+ } else {
+ w.RawString("null")
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *Optional) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ if l.IsNull() {
+ l.Skip()
+ *v = Optional{}
+ } else {
+ v.V = l.Optional()
+ v.Defined = true
+ }
+}
+
+// MarshalJSON implements a standard json marshaler interface.
+func (v Optional) MarshalJSON() ([]byte, error) {
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.Buffer.BuildBytes(), w.Error
+}
+
+// UnmarshalJSON implements a standard json unmarshaler interface.
+func (v *Optional) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// IsDefined returns whether the value is defined, a function is required so that it can
+// be used in an interface.
+func (v Optional) IsDefined() bool {
+ return v.Defined
+}
+
+// String implements a stringer interface using fmt.Sprint for the value.
+func (v Optional) String() string {
+ if !v.Defined {
+ return "<undefined>"
+ }
+ return fmt.Sprint(v.V)
+}
diff --git a/vendor/github.com/mailru/easyjson/opt/opts.go b/vendor/github.com/mailru/easyjson/opt/opts.go
new file mode 100644
index 000000000..3617f7f9f
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/opt/opts.go
@@ -0,0 +1,22 @@
+package opt
+
+//go:generate sed -i "s/\\+build none/generated by gotemplate/" optional/opt.go
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int(int)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint(uint)
+
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int8(int8)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int16(int16)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int32(int32)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int64(int64)
+
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint8(uint8)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint16(uint16)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint32(uint32)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint64(uint64)
+
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Float32(float32)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Float64(float64)
+
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Bool(bool)
+//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" String(string)
+//go:generate sed -i "s/generated by gotemplate/+build none/" optional/opt.go