rule_mgr

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RULEPREFIX = "rule-"
)

Variables

This section is empty.

Functions

func SetFSM

func SetFSM(rule *Rule)

Types

type Rule

type Rule struct {
	Address string             `json:"address"`
	ChainId string             `json:"chain_id"`
	Status  g.GovernanceStatus `json:"status"`
	FSM     *fsm.FSM           `json:"fsm"`
}

type RuleManager

type RuleManager struct {
	g.Persister
}

func (*RuleManager) All

func (rm *RuleManager) All(chainId []byte) (bool, []byte)

Appchains returns all appchains

func (*RuleManager) BindPre

func (rm *RuleManager) BindPre(chainId, ruleAddress string) (bool, []byte)

BindPre checks if the rule address can bind with appchain id and record rule

func (*RuleManager) ChangeStatus

func (rm *RuleManager) ChangeStatus(ruleAddress, trigger string, chainId []byte) (bool, []byte)

func (*RuleManager) CountAll

func (rm *RuleManager) CountAll(chainId []byte) (bool, []byte)

func (*RuleManager) CountAvailable

func (rm *RuleManager) CountAvailable(chainId []byte) (bool, []byte)

CountAvailable counts all rules of one appchain including available

func (*RuleManager) GetAvailableRuleAddress

func (rm *RuleManager) GetAvailableRuleAddress(chainId, chainType string) (bool, []byte)

func (*RuleManager) IsAvailable

func (rm *RuleManager) IsAvailable(chainId, ruleAddress string) (bool, []byte)

func (*RuleManager) QueryById

func (rm *RuleManager) QueryById(ruleAddress string, chainId []byte) (bool, []byte)

type RuleMgr

type RuleMgr interface {
	governance.Governance

	BindPre(chainId, ruleAddress string) (bool, []byte)

	GetAvailableRuleAddress(chainId, chainType string) (bool, []byte)

	IsAvailable(chainId, ruleId string) (bool, []byte)
}

func New

func New(persister g.Persister) RuleMgr

Jump to

Keyboard shortcuts

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