Documentation ¶
Index ¶
- Constants
- Variables
- func F(input []byte) string
- func FileIsExist(name string) bool
- func GenRandomID() uint64
- func GetCurExecDir() string
- func GetCurRootDir() string
- func GetSum(b []byte) string
- func MakeDir(name string) error
- func SetRootDir(path string)
- type Config
- type Logger
- type Reactor
- type Switch
Constants ¶
View Source
const ( ConsensusModule = "consensus" ConsensusChannel = int32(0) HotstuffChaindStep = 3 )
Variables ¶
View Source
var ( ErrValNotFound = errors.New("cannot find target, it's a nil pointer or an empty value struct") ErrWrongElement = errors.New("element type invalid, check parameters") ErrParentEmptyNode = errors.New("node's parent is empty") ErrOrphanNode = errors.New("cannot find the location where the node can be inserted") ErrRepeatInsert = errors.New("key has been inserted before") )
View Source
var ( IDToModuleMap = map[int32]string{ ConsensusChannel: ConsensusModule, } )
Functions ¶
func FileIsExist ¶
func GenRandomID ¶
func GenRandomID() uint64
func GetCurExecDir ¶
func GetCurExecDir() string
func GetCurRootDir ¶
func GetCurRootDir() string
func SetRootDir ¶
func SetRootDir(path string)
Types ¶
type Config ¶
type Config struct { Host string `yaml:"host,omitempty"` Module string `yaml:"module,omitempty"` Filename string `yaml:"filename,omitempty"` Address string `yaml:"address,omitempty"` Bootstrap []string `yaml:"bootstrap,omitempty"` Netpath string `yaml:"netpath,omitempty"` Keypath string `yaml:"keypath,omitempty"` // TODO: loading WAL instead of configuration Round int `yaml:"round,omitempty"` Startk string `yaml:"startk,omitempty"` Startv string `yaml:"startv,omitempty"` Validators []string `yaml:"validators,omitempty"` }
type Logger ¶
type Logger interface { Error(msg string, ctx ...interface{}) Warn(msg string, ctx ...interface{}) Info(msg string, ctx ...interface{}) Trace(msg string, ctx ...interface{}) Debug(msg string, ctx ...interface{}) }
Logger is what any go-hotstuff library should take.
Click to show internal directories.
Click to hide internal directories.