common

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BalanceToRaw added in v0.0.9

func BalanceToRaw(b types.Balance, unit string) (types.Balance, error)

func ChainToken added in v1.0.1

func ChainToken() types.Hash

func GasAddress added in v1.0.4

func GasAddress() types.Address

func GasBlock added in v1.0.4

func GasBlock() types.StateBlock

func GasBlockHash added in v1.0.4

func GasBlockHash() types.Hash

func GasMintageBlock added in v1.0.4

func GasMintageBlock() types.StateBlock

func GasMintageHash added in v1.0.4

func GasMintageHash() types.Hash

func GasToken added in v1.0.4

func GasToken() types.Hash

func GenesisAddress added in v1.0.1

func GenesisAddress() types.Address

func GenesisBlock added in v1.0.1

func GenesisBlock() types.StateBlock

func GenesisBlockHash added in v1.0.1

func GenesisBlockHash() types.Hash

func GenesisMintageBlock added in v0.0.9

func GenesisMintageBlock() types.StateBlock

func GenesisMintageHash added in v0.0.9

func GenesisMintageHash() types.Hash

func IsGenesisBlock added in v0.0.9

func IsGenesisBlock(block *types.StateBlock) bool

IsGenesis check block is chain token genesis

func IsGenesisToken added in v1.0.4

func IsGenesisToken(hash types.Hash) bool

IsGenesis check token is chain token genesis

func RawToBalance added in v0.0.9

func RawToBalance(b types.Balance, unit string) (types.Balance, error)

func TimeNow added in v1.1.0

func TimeNow() time.Time

Types

type Service

type Service interface {
	Init() error
	Start() error
	Stop() error
	Status() int32
}

Service action and status

type ServiceLifecycle

type ServiceLifecycle struct {
	Status int32 // ServiceStatus
}

func (*ServiceLifecycle) PostInit

func (s *ServiceLifecycle) PostInit() bool

func (*ServiceLifecycle) PostStart

func (s *ServiceLifecycle) PostStart() bool

func (*ServiceLifecycle) PostStop

func (s *ServiceLifecycle) PostStop() bool

func (*ServiceLifecycle) PreInit

func (s *ServiceLifecycle) PreInit() bool

func (*ServiceLifecycle) PreStart

func (s *ServiceLifecycle) PreStart() bool

func (*ServiceLifecycle) PreStop

func (s *ServiceLifecycle) PreStop() bool

func (*ServiceLifecycle) State

func (s *ServiceLifecycle) State() int32

func (*ServiceLifecycle) Stopped

func (s *ServiceLifecycle) Stopped() bool

func (*ServiceLifecycle) String

func (s *ServiceLifecycle) String() string

type ServiceStatus

type ServiceStatus int32
const (
	Origin ServiceStatus = iota
	Initialing
	Inited
	Starting
	Started
	Stopping
	Stopped
)

func (ServiceStatus) String

func (i ServiceStatus) String() string

type TopicType added in v1.1.0

type TopicType string
const (
	EventPublish        TopicType = "publish"
	EventConfirmReq     TopicType = "confirmReq"
	EventConfirmAck     TopicType = "confirmAck"
	EventSyncBlock      TopicType = "syncBlock"
	EventConfirmedBlock TopicType = "confirmedBlock"
	EventBroadcast      TopicType = "broadcast"
	EventSendMsgToPeers TopicType = "sendMsgToPeers"
	EventPeersInfo      TopicType = "peersInfo"
	EventAddRelation    TopicType = "addRelation"
	EventDeleteRelation TopicType = "deleteRelation"
)

Topic type

Directories

Path Synopsis
Package common contains various helper functions.
Package common contains various helper functions.
hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.

Jump to

Keyboard shortcuts

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