Documentation ¶
Index ¶
- Variables
- type BigInt
- func (b *BigInt) Add(n *big.Int)
- func (b BigInt) Equals(n *big.Int) bool
- func (b BigInt) Gt(n *big.Int) bool
- func (b BigInt) Gte(n *big.Int) bool
- func (b BigInt) Int() *big.Int
- func (b BigInt) Int64() int64
- func (b BigInt) Lt(n *big.Int) bool
- func (b BigInt) Lte(n *big.Int) bool
- func (b BigInt) MarshalJSON() ([]byte, error)
- func (b BigInt) MarshalText() ([]byte, error)
- func (b *BigInt) Scan(src interface{}) error
- func (b *BigInt) SetString(s string, base int) bool
- func (b BigInt) String() string
- func (b *BigInt) Sub(n *big.Int)
- func (b BigInt) Uint64() uint64
- func (b *BigInt) UnmarshalJSON(text []byte) error
- func (b *BigInt) UnmarshalText(text []byte) error
- func (b BigInt) Value() (driver.Value, error)
- type Hash
- func (h *Hash) Hash() common.Hash
- func (h Hash) IsValidAddress() bool
- func (h Hash) IsValidTxnHash() bool
- func (h Hash) IsZeroValue() bool
- func (h *Hash) MarshalText() ([]byte, error)
- func (h *Hash) Scan(src interface{}) error
- func (h Hash) String() string
- func (h Hash) ToAddress() common.Address
- func (h Hash) ToHash() common.Hash
- func (h *Hash) UnmarshalText(src []byte) error
- func (h Hash) Value() (driver.Value, error)
- type HashMaybe
- type Hexer
- type JSONString
- type Key
Constants ¶
This section is empty.
Variables ¶
var ( EmptyKey = [16]byte{} EmptyKeySlice = EmptyKey[:] )
Functions ¶
This section is empty.
Types ¶
type BigInt ¶
BigInt is a type alias for big.Int used for JSON/Database marshalling.
For JSON values we encoded BigInt's as strings.
For Database values we encoded BigInt's as NUMERIC(78).
func NewBigIntFromString ¶ added in v0.4.1
func ToBigIntArray ¶
func ToBigIntFromInt64 ¶
func (BigInt) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (BigInt) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*BigInt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
func (*BigInt) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Hash ¶
type Hash string
Hash is a type alias for common.Hash used for data normalization with JSON/Database marshalling.
NOTE: when used with a db like postgres, the column type must be a `bytea`
func HashFromBytes ¶ added in v0.4.25
func HashFromString ¶
func (Hash) IsValidAddress ¶
func (Hash) IsValidTxnHash ¶
func (Hash) IsZeroValue ¶
func (*Hash) MarshalText ¶
UnmarshalText implements encoding.TextMarshaler.
func (*Hash) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type HashMaybe ¶ added in v0.4.23
type HashMaybe struct { Hash // IsAssigned=false means value is nil. IsAssigned=true means value in .Hash is the value. IsAssigned bool }
HashMaybe is a nullable Hash value useful for database fields which accept NULL type.
func BytesToHashMaybe ¶ added in v0.4.23
func HashMaybeFromString ¶ added in v0.4.23
func ToHashMaybe ¶ added in v0.4.23
func (HashMaybe) MarshalText ¶ added in v0.4.23
UnmarshalText implements encoding.TextMarshaler.
func (*HashMaybe) UnmarshalText ¶ added in v0.4.23
UnmarshalText implements encoding.TextUnmarshaler.
type JSONString ¶ added in v0.5.8
type JSONString struct {
// contains filtered or unexported fields
}
JSONString is a custom database type that gets serialized into a text value.
func NewJSONString ¶ added in v0.5.8
func NewJSONString(v interface{}) *JSONString
func (JSONString) Data ¶ added in v0.5.8
func (s JSONString) Data() interface{}
func (JSONString) MarshalJSON ¶ added in v0.5.8
func (s JSONString) MarshalJSON() ([]byte, error)
func (*JSONString) Scan ¶ added in v0.5.8
func (s *JSONString) Scan(in interface{}) error
func (*JSONString) UnmarshalJSON ¶ added in v0.5.8
func (s *JSONString) UnmarshalJSON(buf []byte) error