types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	*big.Int
}

Amount represense a avalanche yocto

func NewAmount

func NewAmount(src string) Amount

NewAmount returns a new amount from the given string

func NewInt64Amount

func NewInt64Amount(val int64) Amount

NewInt64Amount returns a new amount for the given int64 value

func (Amount) Add

func (a Amount) Add(b Amount) Amount

Add adds two numbers

func (Amount) Compare

func (a Amount) Compare(b Amount) int

Compare compares two amounts

func (Amount) MarshalJSON

func (a Amount) MarshalJSON() ([]byte, error)

MarshalJSON returns a JSON representation of amount

func (Amount) Mul

func (a Amount) Mul(b Amount) Amount

Mul multiplies two numbers

func (Amount) PercentOf

func (a Amount) PercentOf(b Amount) float64

func (*Amount) Scan

func (a *Amount) Scan(value interface{}) error

Scan assigns the value from interface

func (Amount) String

func (a Amount) String() string

func (Amount) Sub

func (a Amount) Sub(b Amount) Amount

Sub substitutes a given amount from the current one

func (Amount) Value

func (a Amount) Value() (driver.Value, error)

Value returns a serialized value

type Map added in v0.3.0

type Map map[string]interface{}

Map implements a database-compatible map

func NewMap added in v0.3.0

func NewMap() Map

NewMap returns a new map

func (Map) GetBool added in v0.3.0

func (m Map) GetBool(key string) bool

func (Map) GetFloat64 added in v0.4.0

func (m Map) GetFloat64(key string) float64

func (Map) GetInt added in v0.3.0

func (m Map) GetInt(key string) int

func (Map) GetString added in v0.3.0

func (m Map) GetString(key string) string

func (*Map) Scan added in v0.3.0

func (m *Map) Scan(src interface{}) error

Scan scants the given value into the map

func (Map) Value added in v0.3.0

func (m Map) Value() (driver.Value, error)

Value returns the db driver value

type StringSlice added in v0.3.0

type StringSlice []string

func (*StringSlice) Scan added in v0.3.0

func (slice *StringSlice) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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