ntypes

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: MIT Imports: 8 Imported by: 0

README

ntypes GoDoc Build Status codecov.io Code Climate Go Report Card

Package provides set of types that helps to build complex protobuf messages that contains optional properties. API can be considered as stable.

Types

Basic
Arrays

Arrays support is not an SQL standard. Extra import needs to be added to make it working with postgres driver:

import _ "github.com/piotrkowalczuk/ntypes/ntypespq"

Interfaces

Some type implements set of interfaces:

Helpers

Besides that each type implementss func <Type>Or(<builtin>) <builtin> {} method. It returns given argument if receiver is not valid or is nil. For example: ntypes.Bool.BoolOr.

Documentation

Overview

Package ntypes is a generated protocol buffer package.

It is generated from these files:

ntypes.proto

It has these top-level messages:

Bytes
BytesArray
String
StringArray
Int32
Int32Array
Int64
Int64Array
Uint32
Uint32Array
Uint64
Uint64Array
Float32
Float32Array
Float64
Float64Array
Bool
BoolArray

Index

Constants

This section is empty.

Variables

View Source
var (
	// StringArrayScan is used by StringArray Scan method.
	StringArrayScan = func(interface{}) ([]string, error) {
		return nil, errors.New("ntypes: StringArrayScan not set")
	}
	// StringArrayValue is used by StringArray Value method.
	StringArrayValue = func([]string) (driver.Value, error) {
		return nil, errors.New("ntypes: StringArrayValue not set")
	}
	// Float64ArrayScan is used by Float64Array Scan method.
	Float64ArrayScan = func(interface{}) ([]float64, error) {
		return nil, errors.New("ntypes: Float64ArrayScan not set")
	}
	// Float64ArrayValue is used by Float64Array Value method.
	Float64ArrayValue = func([]float64) (driver.Value, error) {
		return nil, errors.New("ntypes: Float64ArrayValue not set")
	}
	// Int64ArrayScan is used by Int64Array Scan method.
	Int64ArrayScan = func(interface{}) ([]int64, error) {
		return nil, errors.New("ntypes: Float64ArrayValue not set")
	}
	// Int64ArrayValue is used by Int64Array Value method.
	Int64ArrayValue = func([]int64) (driver.Value, error) {
		return nil, errors.New("ntypes: Int64ArrayValue not set")
	}
	// BoolArrayScan is used by BoolArray Scan method.
	BoolArrayScan = func(interface{}) ([]bool, error) {
		return nil, errors.New("ntypes: BoolArrayScan not set")
	}
	// BoolArrayValue is used by BoolArray Value method.
	BoolArrayValue = func([]bool) (driver.Value, error) {
		return nil, errors.New("ntypes: BoolArrayValue not set")
	}
	// BytesArrayScan is used by BytesArray Scan method.
	BytesArrayScan = func(interface{}) ([][]byte, error) {
		return nil, errors.New("ntypes: BytesArrayScan not set")
	}
	// ByteArrayValue is used by BytesArray Value method.
	BytesArrayValue = func([][]byte) (driver.Value, error) {
		return nil, errors.New("ntypes: BytesArrayValue not set")
	}
)

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Bool  bool `protobuf:"varint,1,opt,name=bool" json:"bool,omitempty"`
	Valid bool `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Bool represents a bool that may be nil.

func False

func False() *Bool

False allocate new valid Bool object that holds false.

func True

func True() *Bool

True allocate new valid Bool object that holds true.

func (*Bool) BoolOr

func (b *Bool) BoolOr(or bool) bool

BoolOr returns given bool value if receiver is nil or invalid.

func (*Bool) Descriptor

func (*Bool) Descriptor() ([]byte, []int)

func (*Bool) GetBool

func (m *Bool) GetBool() bool

func (*Bool) GetValid

func (m *Bool) GetValid() bool

func (*Bool) MarshalJSON

func (b *Bool) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Bool) ProtoMessage

func (*Bool) ProtoMessage()

func (*Bool) Reset

func (m *Bool) Reset()

func (*Bool) Scan

func (b *Bool) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Bool) String

func (m *Bool) String() string

func (*Bool) UnmarshalJSON

func (b *Bool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Bool) Value

func (b Bool) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type BoolArray

type BoolArray struct {
	BoolArray []bool `protobuf:"varint,1,rep,packed,name=bool_array,json=boolArray" json:"bool_array,omitempty"`
	Valid     bool   `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

BoolArray represents an array of booleans that may be nil.

func (*BoolArray) BoolArrayOr

func (ba *BoolArray) BoolArrayOr(or []bool) []bool

BoolArrayOr returns given slice if receiver is nil or invalid.

func (*BoolArray) Descriptor

func (*BoolArray) Descriptor() ([]byte, []int)

func (*BoolArray) GetBoolArray

func (m *BoolArray) GetBoolArray() []bool

func (*BoolArray) GetValid

func (m *BoolArray) GetValid() bool

func (*BoolArray) MarshalJSON

func (ba *BoolArray) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*BoolArray) ProtoMessage

func (*BoolArray) ProtoMessage()

func (*BoolArray) Reset

func (m *BoolArray) Reset()

func (*BoolArray) Scan

func (ba *BoolArray) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*BoolArray) String

func (m *BoolArray) String() string

func (*BoolArray) UnmarshalJSON

func (ba *BoolArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (BoolArray) Value

func (ba BoolArray) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Bytes

type Bytes struct {
	Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"`
	Valid bool   `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Bytes represents a byte slice that may be nil.

func (*Bytes) Descriptor

func (*Bytes) Descriptor() ([]byte, []int)

func (*Bytes) GetBytes

func (m *Bytes) GetBytes() []byte

func (*Bytes) GetValid

func (m *Bytes) GetValid() bool

func (*Bytes) ProtoMessage

func (*Bytes) ProtoMessage()

func (*Bytes) Reset

func (m *Bytes) Reset()

func (*Bytes) String

func (m *Bytes) String() string

type BytesArray

type BytesArray struct {
	BytesArray [][]byte `protobuf:"bytes,1,rep,name=bytes_array,json=bytesArray,proto3" json:"bytes_array,omitempty"`
	Valid      bool     `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

BytesArray represents an array of byte slices that may be nil.

func (*BytesArray) BytesArrayOr

func (ba *BytesArray) BytesArrayOr(or [][]byte) [][]byte

BytesArrayOr returns given slice if receiver is nil or invalid.

func (*BytesArray) Descriptor

func (*BytesArray) Descriptor() ([]byte, []int)

func (*BytesArray) GetBytesArray

func (m *BytesArray) GetBytesArray() [][]byte

func (*BytesArray) GetValid

func (m *BytesArray) GetValid() bool

func (*BytesArray) MarshalJSON

func (ba *BytesArray) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*BytesArray) ProtoMessage

func (*BytesArray) ProtoMessage()

func (*BytesArray) Reset

func (m *BytesArray) Reset()

func (*BytesArray) Scan

func (ba *BytesArray) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*BytesArray) String

func (m *BytesArray) String() string

func (*BytesArray) UnmarshalJSON

func (ba *BytesArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (BytesArray) Value

func (ba BytesArray) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Float32

type Float32 struct {
	Float32 float32 `protobuf:"fixed32,1,opt,name=float32" json:"float32,omitempty"`
	Valid   bool    `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Float32 represents a Float32 that may be nil.

func NewFloat32

func NewFloat32(f float32) *Float32

NewFloat32 allocates new valid Float32.

func (*Float32) Descriptor

func (*Float32) Descriptor() ([]byte, []int)

func (*Float32) Float32Or

func (f *Float32) Float32Or(or float32) float32

Float32Or returns given Float32 value if receiver is nil or invalid.

func (*Float32) GetFloat32

func (m *Float32) GetFloat32() float32

func (*Float32) GetValid

func (m *Float32) GetValid() bool

func (*Float32) MarshalJSON

func (f *Float32) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Float32) ProtoMessage

func (*Float32) ProtoMessage()

func (*Float32) Reset

func (m *Float32) Reset()

func (*Float32) Scan

func (f *Float32) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Float32) String

func (m *Float32) String() string

func (*Float32) UnmarshalJSON

func (f *Float32) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Float32) Value

func (f Float32) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Float32Array

type Float32Array struct {
	Float32Array []float32 `protobuf:"fixed32,1,rep,packed,name=float32_array,json=float32Array" json:"float32_array,omitempty"`
	Valid        bool      `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Float32Array represents an array of float32s that may be nil.

func (*Float32Array) Descriptor

func (*Float32Array) Descriptor() ([]byte, []int)

func (*Float32Array) Float32ArrayOr

func (fa *Float32Array) Float32ArrayOr(or []float32) []float32

Float32ArrayOr returns given slice if receiver is nil or invalid.

func (*Float32Array) GetFloat32Array

func (m *Float32Array) GetFloat32Array() []float32

func (*Float32Array) GetValid

func (m *Float32Array) GetValid() bool

func (*Float32Array) MarshalJSON

func (fa *Float32Array) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Float32Array) ProtoMessage

func (*Float32Array) ProtoMessage()

func (*Float32Array) Reset

func (m *Float32Array) Reset()

func (*Float32Array) String

func (m *Float32Array) String() string

func (*Float32Array) UnmarshalJSON

func (fa *Float32Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type Float64

type Float64 struct {
	Float64 float64 `protobuf:"fixed64,1,opt,name=float64" json:"float64,omitempty"`
	Valid   bool    `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Float64 represents a Float64 that may be nil.

func NewFloat64

func NewFloat64(f float64) *Float64

NewFloat64 allocates new valid Float64.

func (*Float64) Descriptor

func (*Float64) Descriptor() ([]byte, []int)

func (*Float64) Float64Or

func (f *Float64) Float64Or(or float64) float64

Float64Or returns given float64 value if receiver is nil or invalid.

func (*Float64) GetFloat64

func (m *Float64) GetFloat64() float64

func (*Float64) GetValid

func (m *Float64) GetValid() bool

func (*Float64) MarshalJSON

func (f *Float64) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Float64) ProtoMessage

func (*Float64) ProtoMessage()

func (*Float64) Reset

func (m *Float64) Reset()

func (*Float64) Scan

func (f *Float64) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Float64) String

func (m *Float64) String() string

func (*Float64) UnmarshalJSON

func (f *Float64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Float64) Value

func (f Float64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Float64Array

type Float64Array struct {
	Float64Array []float64 `protobuf:"fixed64,1,rep,packed,name=float64_array,json=float64Array" json:"float64_array,omitempty"`
	Valid        bool      `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Float64Array represents an array of float64s that may be nil.

func (*Float64Array) Descriptor

func (*Float64Array) Descriptor() ([]byte, []int)

func (*Float64Array) Float64ArrayOr

func (fa *Float64Array) Float64ArrayOr(or []float64) []float64

Float64ArrayOr returns given slice if receiver is nil or invalid.

func (*Float64Array) GetFloat64Array

func (m *Float64Array) GetFloat64Array() []float64

func (*Float64Array) GetValid

func (m *Float64Array) GetValid() bool

func (*Float64Array) MarshalJSON

func (fa *Float64Array) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Float64Array) ProtoMessage

func (*Float64Array) ProtoMessage()

func (*Float64Array) Reset

func (m *Float64Array) Reset()

func (*Float64Array) Scan

func (fa *Float64Array) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Float64Array) String

func (m *Float64Array) String() string

func (*Float64Array) UnmarshalJSON

func (fa *Float64Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Float64Array) Value

func (fa Float64Array) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Int32

type Int32 struct {
	Int32 int32 `protobuf:"varint,1,opt,name=int32" json:"int32,omitempty"`
	Valid bool  `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Int32 represents a int32 that may be nil.

func NewInt32

func NewInt32(i int32) *Int32

NewInt32 allocates new valid Int32.

func (*Int32) Descriptor

func (*Int32) Descriptor() ([]byte, []int)

func (*Int32) GetInt32

func (m *Int32) GetInt32() int32

func (*Int32) GetValid

func (m *Int32) GetValid() bool

func (*Int32) Int32Or

func (i *Int32) Int32Or(or int32) int32

Int32Or returns given int32 value if receiver is nil or invalid.

func (*Int32) MarshalJSON

func (i *Int32) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Int32) ProtoMessage

func (*Int32) ProtoMessage()

func (*Int32) Reset

func (m *Int32) Reset()

func (*Int32) Scan

func (i *Int32) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Int32) String

func (m *Int32) String() string

func (*Int32) UnmarshalJSON

func (i *Int32) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Int32) Value

func (i Int32) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Int32Array

type Int32Array struct {
	Int32Array []int32 `protobuf:"varint,1,rep,packed,name=int32_array,json=int32Array" json:"int32_array,omitempty"`
	Valid      bool    `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Int32Array represents an array of int32s that may be nil.

func (*Int32Array) Descriptor

func (*Int32Array) Descriptor() ([]byte, []int)

func (*Int32Array) GetInt32Array

func (m *Int32Array) GetInt32Array() []int32

func (*Int32Array) GetValid

func (m *Int32Array) GetValid() bool

func (*Int32Array) Int32ArrayOr

func (ia *Int32Array) Int32ArrayOr(or []int32) []int32

Int32ArrayOr returns given slice if receiver is nil or invalid.

func (*Int32Array) MarshalJSON

func (ia *Int32Array) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Int32Array) ProtoMessage

func (*Int32Array) ProtoMessage()

func (*Int32Array) Reset

func (m *Int32Array) Reset()

func (*Int32Array) String

func (m *Int32Array) String() string

func (*Int32Array) UnmarshalJSON

func (ia *Int32Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type Int64

type Int64 struct {
	Int64 int64 `protobuf:"varint,1,opt,name=int64" json:"int64,omitempty"`
	Valid bool  `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Int64 represents a int64 that may be nil.

func NewInt64

func NewInt64(i int64) *Int64

NewInt64 allocates new valid Int64.

func (*Int64) Descriptor

func (*Int64) Descriptor() ([]byte, []int)

func (*Int64) GetInt64

func (m *Int64) GetInt64() int64

func (*Int64) GetValid

func (m *Int64) GetValid() bool

func (*Int64) Int64Or

func (i *Int64) Int64Or(or int64) int64

Int64Or returns given int64 value if receiver is nil or invalid.

func (*Int64) MarshalJSON

func (i *Int64) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Int64) ProtoMessage

func (*Int64) ProtoMessage()

func (*Int64) Reset

func (m *Int64) Reset()

func (*Int64) Scan

func (i *Int64) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Int64) String

func (m *Int64) String() string

func (*Int64) UnmarshalJSON

func (i *Int64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Int64) Value

func (i Int64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Int64Array

type Int64Array struct {
	Int64Array []int64 `protobuf:"varint,1,rep,packed,name=int64_array,json=int64Array" json:"int64_array,omitempty"`
	Valid      bool    `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Int64Array represents an array of int64s that may be nil.

func (*Int64Array) Descriptor

func (*Int64Array) Descriptor() ([]byte, []int)

func (*Int64Array) GetInt64Array

func (m *Int64Array) GetInt64Array() []int64

func (*Int64Array) GetValid

func (m *Int64Array) GetValid() bool

func (*Int64Array) Int64ArrayOr

func (ia *Int64Array) Int64ArrayOr(or []int64) []int64

Int64ArrayOr returns given slice if receiver is nil or invalid.

func (*Int64Array) MarshalJSON

func (ia *Int64Array) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Int64Array) ProtoMessage

func (*Int64Array) ProtoMessage()

func (*Int64Array) Reset

func (m *Int64Array) Reset()

func (*Int64Array) Scan

func (ia *Int64Array) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Int64Array) String

func (m *Int64Array) String() string

func (*Int64Array) UnmarshalJSON

func (ia *Int64Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Int64Array) Value

func (ia Int64Array) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type String

type String struct {
	Chars string `protobuf:"bytes,1,opt,name=chars" json:"chars,omitempty"`
	Valid bool   `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

String represents a string that may be nil.

func NewString

func NewString(s string) *String

NewString allocates new valid string.

func (*String) Descriptor

func (*String) Descriptor() ([]byte, []int)

func (*String) GetChars

func (m *String) GetChars() string

func (*String) GetValid

func (m *String) GetValid() bool

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*String) ProtoMessage

func (*String) ProtoMessage()

func (*String) Reset

func (m *String) Reset()

func (*String) Scan

func (s *String) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*String) String

func (m *String) String() string

func (*String) StringOr

func (s *String) StringOr(or string) string

StringOr returns given string value if receiver is nil or invalid.

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (String) Value

func (s String) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type StringArray

type StringArray struct {
	StringArray []string `protobuf:"bytes,1,rep,name=string_array,json=stringArray" json:"string_array,omitempty"`
	Valid       bool     `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

StringArray represents an array of strings that may be nil.

func (*StringArray) Descriptor

func (*StringArray) Descriptor() ([]byte, []int)

func (*StringArray) GetStringArray

func (m *StringArray) GetStringArray() []string

func (*StringArray) GetValid

func (m *StringArray) GetValid() bool

func (*StringArray) MarshalJSON

func (sa *StringArray) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*StringArray) ProtoMessage

func (*StringArray) ProtoMessage()

func (*StringArray) Reset

func (m *StringArray) Reset()

func (*StringArray) Scan

func (sa *StringArray) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*StringArray) String

func (m *StringArray) String() string

func (*StringArray) StringArrayOr

func (sa *StringArray) StringArrayOr(or []string) []string

StringArrayOr returns given slice if receiver is nil or invalid.

func (*StringArray) UnmarshalJSON

func (sa *StringArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (StringArray) Value

func (sa StringArray) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Uint32

type Uint32 struct {
	Uint32 uint32 `protobuf:"varint,1,opt,name=uint32" json:"uint32,omitempty"`
	Valid  bool   `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Uint32 represents a Uint32 that may be nil.

func NewUint32

func NewUint32(u uint32) *Uint32

NewUint32 allocates new valid Uint32.

func (*Uint32) Descriptor

func (*Uint32) Descriptor() ([]byte, []int)

func (*Uint32) GetUint32

func (m *Uint32) GetUint32() uint32

func (*Uint32) GetValid

func (m *Uint32) GetValid() bool

func (*Uint32) MarshalJSON

func (u *Uint32) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Uint32) ProtoMessage

func (*Uint32) ProtoMessage()

func (*Uint32) Reset

func (m *Uint32) Reset()

func (*Uint32) Scan

func (u *Uint32) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*Uint32) String

func (m *Uint32) String() string

func (*Uint32) Uint32Or

func (u *Uint32) Uint32Or(or uint32) uint32

Uint32Or returns given uint32 value if receiver is nil or invalid.

func (*Uint32) UnmarshalJSON

func (u *Uint32) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Uint32) Value

func (u Uint32) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Uint32Array

type Uint32Array struct {
	Uint32Array []uint32 `protobuf:"varint,1,rep,packed,name=uint32_array,json=uint32Array" json:"uint32_array,omitempty"`
	Valid       bool     `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Uint32Array represents an array of uint32s that may be nil.

func (*Uint32Array) Descriptor

func (*Uint32Array) Descriptor() ([]byte, []int)

func (*Uint32Array) GetUint32Array

func (m *Uint32Array) GetUint32Array() []uint32

func (*Uint32Array) GetValid

func (m *Uint32Array) GetValid() bool

func (*Uint32Array) MarshalJSON

func (ua *Uint32Array) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Uint32Array) ProtoMessage

func (*Uint32Array) ProtoMessage()

func (*Uint32Array) Reset

func (m *Uint32Array) Reset()

func (*Uint32Array) String

func (m *Uint32Array) String() string

func (*Uint32Array) Uint32ArrayOr

func (ua *Uint32Array) Uint32ArrayOr(or []uint32) []uint32

Uint32ArrayOr returns given slice if receiver is nil or invalid.

func (*Uint32Array) UnmarshalJSON

func (ua *Uint32Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type Uint64

type Uint64 struct {
	Uint64 uint64 `protobuf:"varint,1,opt,name=uint64" json:"uint64,omitempty"`
	Valid  bool   `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Uint64 represents a Uint64 that may be nil.

func NewUint64

func NewUint64(u uint64) *Uint64

NewUint64 allocates new valid Uint64.

func (*Uint64) Descriptor

func (*Uint64) Descriptor() ([]byte, []int)

func (*Uint64) GetUint64

func (m *Uint64) GetUint64() uint64

func (*Uint64) GetValid

func (m *Uint64) GetValid() bool

func (*Uint64) MarshalJSON

func (u *Uint64) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Uint64) ProtoMessage

func (*Uint64) ProtoMessage()

func (*Uint64) Reset

func (m *Uint64) Reset()

func (*Uint64) String

func (m *Uint64) String() string

func (*Uint64) Uint64Or

func (u *Uint64) Uint64Or(or uint64) uint64

Uint64Or returns given uint64 value if receiver is nil or invalid.

func (*Uint64) UnmarshalJSON

func (u *Uint64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type Uint64Array

type Uint64Array struct {
	Uint64Array []uint64 `protobuf:"varint,1,rep,packed,name=uint64_array,json=uint64Array" json:"uint64_array,omitempty"`
	Valid       bool     `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"`
}

Uint64Array represents an array of uint64s that may be nil.

func (*Uint64Array) Descriptor

func (*Uint64Array) Descriptor() ([]byte, []int)

func (*Uint64Array) GetUint64Array

func (m *Uint64Array) GetUint64Array() []uint64

func (*Uint64Array) GetValid

func (m *Uint64Array) GetValid() bool

func (*Uint64Array) MarshalJSON

func (ua *Uint64Array) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Uint64Array) ProtoMessage

func (*Uint64Array) ProtoMessage()

func (*Uint64Array) Reset

func (m *Uint64Array) Reset()

func (*Uint64Array) String

func (m *Uint64Array) String() string

func (*Uint64Array) Uint64ArrayOr

func (ua *Uint64Array) Uint64ArrayOr(or []uint64) []uint64

Uint64ArrayOr returns given slice if receiver is nil or invalid.

func (*Uint64Array) UnmarshalJSON

func (ua *Uint64Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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