Documentation ¶
Index ¶
- Constants
- func IsHash(s string) bool
- func IsHexAddress(s string) bool
- type Address
- func (a Address) Big() *big.Int
- func (a Address) Bytes() []byte
- func (a Address) Equals(b Address) bool
- func (a *Address) FromBytes(b []byte) error
- func (a Address) Hex() string
- func (a *Address) SetBytes(b []byte)
- func (a Address) Str() string
- func (a Address) String() string
- func (a Address) ToBytes() ([]byte, error)
- type Bandwidth
- func (b *Bandwidth) Add(obj *Bandwidth)
- func (b *Bandwidth) CPUUsage() uint64
- func (b *Bandwidth) CalcPoints(p Price) (points *util.Uint128, err error)
- func (b *Bandwidth) Clone() *Bandwidth
- func (b Bandwidth) IsZero() bool
- func (b *Bandwidth) NetUsage() uint64
- func (b *Bandwidth) SetCPUUsage(cpuUsage uint64)
- func (b *Bandwidth) SetNetUsage(netUsage uint64)
- func (b *Bandwidth) Sub(obj *Bandwidth)
- type Price
Constants ¶
View Source
const ( AddressLength = 33 HashLength = 32 )
Types' length.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address [AddressLength]byte
Address represents Address.
func BytesToAddress ¶
BytesToAddress gets Address from bytes.
func HexToAddress ¶
HexToAddress gets Address from hex string.
func PublicKeyToAddress ¶
PublicKeyToAddress gets Address from PublicKey.
type Bandwidth ¶
type Bandwidth struct {
// contains filtered or unexported fields
}
Bandwidth is structure for cpu and net bandwidth
func NewBandwidth ¶
NewBandwidth returns new bandwidth
func (*Bandwidth) CalcPoints ¶
CalcPoints multiply bandwidth and price
func (*Bandwidth) SetCPUUsage ¶
SetCPUUsage sets cpuUsage
func (*Bandwidth) SetNetUsage ¶
SetNetUsage sets netUsage
Click to show internal directories.
Click to hide internal directories.