Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDecoder ¶ added in v1.7.0
GetDecoder retrieves a nexemab.Decoder instance
func GetEncoder ¶ added in v1.7.0
GetEncoder retrieves a nexemab.Encoder instance
Types ¶
type NexemaType ¶ added in v1.7.0
type NexemaType struct {
NoCopy
}
NexemaType represents the base struct for any Nexema's type. This is not meant to be used at runtime
type Nexemable ¶ added in v1.7.0
type Nexemable interface { Encode() ([]byte, error) MustEncode() []byte Decode(reader io.Reader) error MustDecode(reader io.Reader) MergeUsing(other Nexemable) error MergeFrom(buffer []byte) error Clone() Nexemable }
Nexemable interface provides methods to serialize and deserialize an struct to/from nexemab. Any struct which implements this interface becomes a Nexemable type.
type NoCopy ¶ added in v1.7.0
noCopy may be embedded into structs which must not be copied after the first use.
See https://golang.org/issues/8005#issuecomment-190753527 for details.
type Nullable ¶
type Nullable[T any] struct { Value *T }
Nullable represents T but allowing to set it as "null"
func NewNullable ¶
NewNullalbe creates a new Nullable[T] setting its value to the pointer of v
func (*Nullable[T]) Clear ¶ added in v1.7.0
func (n *Nullable[T]) Clear()
Clear clears the underlying value, setting it as null
func (*Nullable[T]) SetValue ¶
func (n *Nullable[T]) SetValue(v T)
SetValues sets the value of the nullable
func (*Nullable[T]) ValueOrZero ¶
func (n *Nullable[T]) ValueOrZero() T
ValueOrZero returns a zero value of T if its null, otherwise, its actual value.