Documentation
¶
Index ¶
- Constants
- func AddDaemonFlags(cmd *cobra.Command)
- func LoadConfigFile(filePath string, dmCfg *DaemonConfig) (err error)
- func PublishDaemonEvent(event DaemonEvent)
- func SubscribeDaemonEvent(path types.EventPath, name string, handler types.EventHandler) error
- func UnsubscribeDaemonEvent(path types.EventPath, name string)
- func WriteConfigFile(filePath string, dmCfg *DaemonConfig) (err error)
- type ClusterState
- type Context
- type DaemonConfig
- type DaemonEvent
- type DefaultContext
- func (ctx *DefaultContext) Debug(msg string, keyvals ...interface{})
- func (ctx *DefaultContext) Error(msg string, keyvals ...interface{})
- func (ctx *DefaultContext) GetClient() types.Client
- func (ctx *DefaultContext) GetClusterState() ClusterState
- func (ctx *DefaultContext) GetConfig() DaemonConfig
- func (ctx *DefaultContext) GetNodeID() string
- func (ctx *DefaultContext) GetTMConfig() *cfg.Config
- func (ctx *DefaultContext) Info(msg string, keyvals ...interface{})
- func (ctx *DefaultContext) LastBlockIndex() int64
- func (ctx *DefaultContext) LastBlockTime() time.Time
- func (ctx *DefaultContext) SetClusterState(state ClusterState)
- func (ctx *DefaultContext) With(keyvals ...interface{}) log.Logger
Constants ¶
View Source
const (
EventScopeDaemon = types.EventScope("daemon")
)
View Source
const (
SpaceDaemon = "daemon"
)
Variables ¶
This section is empty.
Functions ¶
func AddDaemonFlags ¶ added in v0.0.2
func LoadConfigFile ¶ added in v0.0.2
func LoadConfigFile(filePath string, dmCfg *DaemonConfig) (err error)
func PublishDaemonEvent ¶
func PublishDaemonEvent(event DaemonEvent)
func SubscribeDaemonEvent ¶
func UnsubscribeDaemonEvent ¶
func WriteConfigFile ¶ added in v0.0.2
func WriteConfigFile(filePath string, dmCfg *DaemonConfig) (err error)
Types ¶
type ClusterState ¶
type Context ¶
type Context interface { log.Logger LastBlockTime() time.Time LastBlockIndex() int64 GetNodeID() string GetClient() types.Client GetTMConfig() *cfg.Config GetConfig() DaemonConfig GetClusterState() ClusterState SetClusterState(state ClusterState) }
func NewContext ¶
type DaemonConfig ¶
type DaemonConfig struct { ChainID string NodeID string NodeName string APIAddr string `mapstructure:"daemon_api_addr"` AliveThresholdBlocks uint `mapstructure:"daemon_alive_threshold"` DelMemberThresholdBlocks uint `mapstructure:"daemon_del_member_threshold"` }
func NewDaemonConfig ¶ added in v0.0.2
func NewDaemonConfig() *DaemonConfig
type DaemonEvent ¶
type DefaultContext ¶
type DefaultContext struct {
// contains filtered or unexported fields
}
func (*DefaultContext) Debug ¶
func (ctx *DefaultContext) Debug(msg string, keyvals ...interface{})
Info log info
func (*DefaultContext) Error ¶
func (ctx *DefaultContext) Error(msg string, keyvals ...interface{})
Info log info
func (*DefaultContext) GetClient ¶
func (ctx *DefaultContext) GetClient() types.Client
func (*DefaultContext) GetClusterState ¶
func (ctx *DefaultContext) GetClusterState() ClusterState
func (*DefaultContext) GetConfig ¶
func (ctx *DefaultContext) GetConfig() DaemonConfig
func (*DefaultContext) GetNodeID ¶
func (ctx *DefaultContext) GetNodeID() string
func (*DefaultContext) GetTMConfig ¶
func (ctx *DefaultContext) GetTMConfig() *cfg.Config
func (*DefaultContext) Info ¶
func (ctx *DefaultContext) Info(msg string, keyvals ...interface{})
Info log info
func (*DefaultContext) LastBlockIndex ¶
func (ctx *DefaultContext) LastBlockIndex() int64
func (*DefaultContext) LastBlockTime ¶
func (ctx *DefaultContext) LastBlockTime() time.Time
func (*DefaultContext) SetClusterState ¶
func (ctx *DefaultContext) SetClusterState(state ClusterState)
func (*DefaultContext) With ¶
func (ctx *DefaultContext) With(keyvals ...interface{}) log.Logger
Info log info
Click to show internal directories.
Click to hide internal directories.