Documentation
¶
Index ¶
- Variables
- type CQLUUID
- func (u CQLUUID) Bytes() []byte
- func (u CQLUUID) Clock() uint32
- func (u *CQLUUID) DecodeMsg(dc *msgp.Reader) (err error)
- func (u *CQLUUID) EncodeMsg(en *msgp.Writer) (err error)
- func (u CQLUUID) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (u CQLUUID) MarshalJSON() ([]byte, error)
- func (u *CQLUUID) MarshalMsg(b []byte) (o []byte, err error)
- func (u CQLUUID) MarshalText() ([]byte, error)
- func (u *CQLUUID) Msgsize() int
- func (u CQLUUID) Node() []byte
- func (u CQLUUID) String() string
- func (u CQLUUID) Time() time.Time
- func (u CQLUUID) Timestamp() int64
- func (u *CQLUUID) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (u *CQLUUID) UnmarshalJSON(data []byte) error
- func (u *CQLUUID) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (u *CQLUUID) UnmarshalText(text []byte) error
- func (u CQLUUID) UnsafeString() string
- func (u CQLUUID) Variant() int
- func (u CQLUUID) Version() int
- type NullBool
- type NullByte
- type NullFloat32
- func (o *NullFloat32) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (o NullFloat32) MarshalJSON() ([]byte, error)
- func (n *NullFloat32) Scan(value any) error
- func (o *NullFloat32) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
- func (o *NullFloat32) UnmarshalJSON(value []byte) error
- func (n NullFloat32) Value() (driver.Value, error)
- type NullFloat64
- type NullInt16
- type NullInt32
- type NullInt64
- type NullString
- type NullTime
- type NullUint16
- func (o NullUint16) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (o NullUint16) MarshalJSON() ([]byte, error)
- func (n *NullUint16) Scan(value any) error
- func (o *NullUint16) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
- func (o *NullUint16) UnmarshalJSON(value []byte) error
- func (n NullUint16) Value() (driver.Value, error)
- type NullUint32
- func (o NullUint32) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (o NullUint32) MarshalJSON() ([]byte, error)
- func (n *NullUint32) Scan(value any) error
- func (o *NullUint32) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
- func (o *NullUint32) UnmarshalJSON(value []byte) error
- func (n NullUint32) Value() (driver.Value, error)
- type NullUint64
- type ObjectID
- type OrderedMap
- func (om OrderedMap[K, V]) Get(key K) (V, bool)
- func (om OrderedMap[K, V]) Iter(yield func(key K, value V) bool)
- func (om *OrderedMap[K, V]) Len() int
- func (om OrderedMap[K, V]) MarshalJSON() ([]byte, error)
- func (om *OrderedMap[K, V]) Reset()
- func (om *OrderedMap[K, V]) Set(key K, value V)
- func (om *OrderedMap[K, V]) SetCompareFunc(cmpFunc func(a, b K) int)
- func (om *OrderedMap[K, V]) UnmarshalJSON(data []byte) error
- func (om *OrderedMap[K, V]) Unset(key K)
- func (om *OrderedMap[K, V]) UnsetCompareFunc()
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidJSON = errors.New("expected a JSON object") ErrInvalidJSONKey = errors.New("expected a string key in JSON") )
var NilObjectID = ObjectID{ ObjectID: primitive.NilObjectID, }
Functions ¶
This section is empty.
Types ¶
type CQLUUID ¶
func (CQLUUID) Bytes ¶
Bytes returns the raw byte slice for this UUID. A CQLUUID is always 128 bits (16 bytes) long.
func (CQLUUID) Clock ¶
Clock extracts the clock sequence of this CQLUUID. It will return zero if the CQLUUID is not a time based UUID (version 1).
func (CQLUUID) MarshalJSON ¶
func (*CQLUUID) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (CQLUUID) MarshalText ¶
func (*CQLUUID) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (CQLUUID) Node ¶
Node extracts the MAC address of the node who generated this CQLUUID. It will return nil if the CQLUUID is not a time based UUID (version 1).
func (CQLUUID) Timestamp ¶
Timestamp extracts the timestamp information from a time based CQLUUID (version 1).
func (*CQLUUID) UnmarshalCQL ¶
func (*CQLUUID) UnmarshalJSON ¶
func (*CQLUUID) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
func (*CQLUUID) UnmarshalText ¶
func (CQLUUID) UnsafeString ¶
String returns the CQLUUID in it's canonical form, a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
type NullBool ¶
func (NullBool) MarshalBSONValue ¶
func (NullBool) MarshalJSON ¶
func (*NullBool) UnmarshalBSONValue ¶
func (*NullBool) UnmarshalJSON ¶
type NullByte ¶
func (NullByte) MarshalBSONValue ¶
func (NullByte) MarshalJSON ¶
func (*NullByte) UnmarshalBSONValue ¶
func (*NullByte) UnmarshalJSON ¶
type NullFloat32 ¶
func (*NullFloat32) MarshalBSONValue ¶
func (o *NullFloat32) MarshalBSONValue() (bsontype.Type, []byte, error)
func (NullFloat32) MarshalJSON ¶
func (o NullFloat32) MarshalJSON() ([]byte, error)
func (*NullFloat32) Scan ¶
func (n *NullFloat32) Scan(value any) error
func (*NullFloat32) UnmarshalBSONValue ¶
func (o *NullFloat32) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
func (*NullFloat32) UnmarshalJSON ¶
func (o *NullFloat32) UnmarshalJSON(value []byte) error
type NullFloat64 ¶
type NullFloat64 sql.NullFloat64
func (NullFloat64) MarshalBSONValue ¶
func (o NullFloat64) MarshalBSONValue() (bsontype.Type, []byte, error)
func (NullFloat64) MarshalJSON ¶
func (o NullFloat64) MarshalJSON() ([]byte, error)
func (*NullFloat64) UnmarshalBSONValue ¶
func (o *NullFloat64) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
func (*NullFloat64) UnmarshalJSON ¶
func (o *NullFloat64) UnmarshalJSON(value []byte) error
type NullInt16 ¶
func (NullInt16) MarshalBSONValue ¶
func (NullInt16) MarshalJSON ¶
func (*NullInt16) UnmarshalBSONValue ¶
func (*NullInt16) UnmarshalJSON ¶
type NullInt32 ¶
func (NullInt32) MarshalBSONValue ¶
func (NullInt32) MarshalJSON ¶
func (*NullInt32) UnmarshalBSONValue ¶
func (*NullInt32) UnmarshalJSON ¶
type NullInt64 ¶
func (NullInt64) MarshalBSONValue ¶
func (NullInt64) MarshalJSON ¶
func (*NullInt64) UnmarshalBSONValue ¶
func (*NullInt64) UnmarshalJSON ¶
type NullString ¶
type NullString sql.NullString
func (NullString) MarshalBSONValue ¶
func (o NullString) MarshalBSONValue() (bsontype.Type, []byte, error)
func (NullString) MarshalJSON ¶
func (o NullString) MarshalJSON() ([]byte, error)
func (*NullString) UnmarshalBSONValue ¶
func (o *NullString) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
func (*NullString) UnmarshalJSON ¶
func (o *NullString) UnmarshalJSON(value []byte) error
type NullUint16 ¶
func (NullUint16) MarshalBSONValue ¶
func (o NullUint16) MarshalBSONValue() (bsontype.Type, []byte, error)
func (NullUint16) MarshalJSON ¶
func (o NullUint16) MarshalJSON() ([]byte, error)
func (*NullUint16) Scan ¶
func (n *NullUint16) Scan(value any) error
func (*NullUint16) UnmarshalBSONValue ¶
func (o *NullUint16) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
func (*NullUint16) UnmarshalJSON ¶
func (o *NullUint16) UnmarshalJSON(value []byte) error
type NullUint32 ¶
func (NullUint32) MarshalBSONValue ¶
func (o NullUint32) MarshalBSONValue() (bsontype.Type, []byte, error)
func (NullUint32) MarshalJSON ¶
func (o NullUint32) MarshalJSON() ([]byte, error)
func (*NullUint32) Scan ¶
func (n *NullUint32) Scan(value any) error
func (*NullUint32) UnmarshalBSONValue ¶
func (o *NullUint32) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
func (*NullUint32) UnmarshalJSON ¶
func (o *NullUint32) UnmarshalJSON(value []byte) error
type NullUint64 ¶
func (NullUint64) MarshalBSONValue ¶
func (o NullUint64) MarshalBSONValue() (bsontype.Type, []byte, error)
func (NullUint64) MarshalJSON ¶
func (o NullUint64) MarshalJSON() ([]byte, error)
func (*NullUint64) UnmarshalBSONValue ¶
func (o *NullUint64) UnmarshalBSONValue(t bsontype.Type, bytes []byte) error
func (*NullUint64) UnmarshalJSON ¶
func (o *NullUint64) UnmarshalJSON(value []byte) error
type ObjectID ¶
func NewObjectID ¶
func NewObjectID() ObjectID
func ObjectIDFromHex ¶
func (ObjectID) MarshalBSONValue ¶
func (ObjectID) MarshalJSON ¶
type OrderedMap ¶ added in v2.4.0
type OrderedMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewOrderedMap ¶ added in v2.4.0
func NewOrderedMap[K comparable, V any](length int) OrderedMap[K, V]
NewOrderedMap
Initializes a new instance of the OrderedMap.
func NewOrderedMapWithCompareFunc ¶ added in v2.4.0
func NewOrderedMapWithCompareFunc[K comparable, V any]( length int, cmpFunc func(a, b K) int, ) OrderedMap[K, V]
NewOrderedMapWithCompareFunc
Initializes a new instance of the OrderedMap with custom ordering dictated by the cmpFunc comparison function.
func (OrderedMap[K, V]) Get ¶ added in v2.4.0
func (om OrderedMap[K, V]) Get(key K) (V, bool)
Get
Gets the value associated with a key. If the key doesn't exist in the map the zero value for the type is returned and the boolean is set to false.
func (OrderedMap[K, V]) Iter ¶ added in v2.4.0
func (om OrderedMap[K, V]) Iter(yield func(key K, value V) bool)
Iter iterates through the map. If the CompareFunc is unset, it iterates in insertion order. Otherwise, it iterates in the order dictated by CompareFunc.
Either use NewOrderedMapWithCompareFunc or call SetCompareFunc to set the comparison function.
func (*OrderedMap[K, V]) Len ¶ added in v2.6.3
func (om *OrderedMap[K, V]) Len() int
Len
Returns the length of the internal map.
func (OrderedMap[K, V]) MarshalJSON ¶ added in v2.6.1
func (om OrderedMap[K, V]) MarshalJSON() ([]byte, error)
MarshalJSON
Serializes the ordered map into a JSON stream.
If the CompareFunc is unset, it serializes in insertion order. Otherwise, it serializes in the order dictated by CompareFunc.
Either use NewOrderedMapWithCompareFunc or call SetCompareFunc to set the comparison function.
func (*OrderedMap[K, V]) Reset ¶ added in v2.4.0
func (om *OrderedMap[K, V]) Reset()
Reset
Resets all state including the comparison function.
func (*OrderedMap[K, V]) Set ¶ added in v2.4.0
func (om *OrderedMap[K, V]) Set(key K, value V)
Inserts a new value into the map while tracking the order.
func (*OrderedMap[K, V]) SetCompareFunc ¶ added in v2.4.0
func (om *OrderedMap[K, V]) SetCompareFunc(cmpFunc func(a, b K) int)
SetCompareFunc
Sets the comparison function to determine ordering.
func (*OrderedMap[K, V]) UnmarshalJSON ¶ added in v2.6.1
func (om *OrderedMap[K, V]) UnmarshalJSON(data []byte) error
UnmarshalJSON
Unserializes JSON objects into an ordered map preserving the order in which keys appear in the input datastream.
Doesn't support unmarshaling JSON arrays as those are already ordered structures for which you shouldn't use this ordered map.
func (*OrderedMap[K, V]) Unset ¶ added in v2.4.0
func (om *OrderedMap[K, V]) Unset(key K)
Unset
Deletes the key from the map.
func (*OrderedMap[K, V]) UnsetCompareFunc ¶ added in v2.4.0
func (om *OrderedMap[K, V]) UnsetCompareFunc()
UnsetCompareFunc
Unsets the comparison function.