vendor: Update vendoring for the exec client and server implementations
Signed-off-by: Jacek J. Łakis <jacek.lakis@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
d25b88583f
commit
bf51655a7b
2124 changed files with 809703 additions and 5 deletions
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Bool) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Float32) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Float64) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Int) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Int16) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Int32) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Int64) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Int8) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_String.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_String.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *String) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Uint) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Uint16) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Uint32) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Uint64) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go
generated
vendored
Normal file
79
vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Uint8) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
80
vendor/github.com/mailru/easyjson/opt/optional/opt.go
generated
vendored
Normal file
80
vendor/github.com/mailru/easyjson/opt/optional/opt.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
// MarshalJSON implements a standard json marshaler interface.
|
||||
func (v *Optional) UnmarshalJSON(data []byte) error {
|
||||
l := jlexer.Lexer{}
|
||||
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)
|
||||
}
|
22
vendor/github.com/mailru/easyjson/opt/opts.go
generated
vendored
Normal file
22
vendor/github.com/mailru/easyjson/opt/opts.go
generated
vendored
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue