Documentation
¶
Index ¶
- type Asset
- func (ma Asset[V]) Add(other Asset[V]) Asset[V]
- func (ma Asset[V]) Clone() Asset[V]
- func (ma Asset[V]) Equal(other Asset[V]) bool
- func (ma Asset[V]) Greater(other Asset[V]) bool
- func (ma Asset[V]) Inverted() Asset[V]
- func (a Asset[V]) IsEmpty() bool
- func (ma Asset[V]) Less(other Asset[V]) bool
- func (a Asset[V]) MarshalCBOR() ([]byte, error)
- func (ma Asset[V]) Sub(other Asset[V]) Asset[V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
func (Asset[V]) Add ¶
*
Add adds another Asset map to the current Asset map. Params: other (Asset[V]): The Asset map to add to the current Asset map. Returns: Asset[V]: The resulting Asset map after addition.
func (Asset[V]) Clone ¶
*
Clone creates a deep copy of an Asset map. Returns: Asset[V]: A deep copy of the original Asset map.
func (Asset[V]) Equal ¶
*
Equal checks if two Asset maps are equal using the function DeepEuqal from the package "reflect". Parameters: other (Asset[V]): The other Asset map to compare to. Returns: bool: true if the two Asset maps are equal, false otherwise.
func (Asset[V]) Greater ¶
*
Greater function checks if the current Asset map is greater than another Asset map. Parameters: other (Asset[V]): The other Asset map to compare to. Returns: bool: true if the current Asset map is greater than the other, false otherwise.
func (Asset[V]) Inverted ¶
*
Inverted creates a copy of an Asset map containing opposite amounts of the original one. Returns: Asset[V]: An inverted copy of the original Asset map.
func (Asset[V]) IsEmpty ¶ added in v1.6.0
IsEmpty returns true if the Asset is nil or empty. This method is used by the CBOR library to determine if the field should be omitted when using the "omitempty" tag.
func (Asset[V]) Less ¶
*
Less function checks if the current Asset map is less than another Asset map. Parameters: other (Asset[V]): The other Asset map to compare to. Returns: bool: true if the current Asset map is less than the other, false otherwise.
func (Asset[V]) MarshalCBOR ¶ added in v1.6.0
MarshalCBOR serializes the Asset to CBOR format with deterministic key ordering. Asset names are sorted lexicographically by their byte representation.
Click to show internal directories.
Click to hide internal directories.