Documentation ¶
Index ¶
- Constants
- Variables
- func DhtCommand(dhtMgr *dht.DhtMgr, cmd int, msg interface{}) sch.SchErrno
- func DhtGetManager(sdl *sch.Scheduler) *dht.DhtMgr
- func DhtInstallCallback(dhtMgr *dht.DhtMgr, cbf dht.DhtCallback) dht.DhtErrno
- func DhtRemoveCallback(dhtMgr *dht.DhtMgr) dht.DhtErrno
- func P2pCreateInstance(cfg *config.Config) (*sch.Scheduler, sch.SchErrno)
- func P2pCreateStaticTaskTab(what P2pType) []sch.TaskStaticDescription
- func P2pStart(sdl *sch.Scheduler) sch.SchErrno
- func P2pStop(sdl *sch.Scheduler, ch chan bool) sch.SchErrno
- func ShellDefaultBootstrapConfig(bsUrls []string) *config.Config
- func ShellDefaultConfig(bsUrls []string) *config.Config
- func ShellGetConfig(name string) *config.Config
- func ShellSetConfig(name string, cfg *config.Config) (string, config.P2pCfgErrno)
- type DhtShellManager
- type P2pErrno
- type P2pType
- type ShellHsInfo
- type ShellManager
- type ShellPeerID
- type ShellPeerSnapshot
Constants ¶
View Source
const ( P2pIndCb = peer.P2pIndCb // callback type for indication P2pPkgCb = peer.P2pPkgCb // callback type for incoming packages )
Register user callback function to p2p
View Source
const ( P2pIndPeerActivated = peer.P2pIndPeerActivated // indication for a peer activated to work P2pIndPeerClosed = peer.P2pIndPeerClosed // indication for peer connection closed )
View Source
const ( PisActive = pisActive PisClosing = pisClosing )
View Source
const ( MID_CHKK = peer.MID_CHKK MID_RPTK = peer.MID_RPTK MID_GCD = peer.MID_GCD MID_PCD = peer.MID_PCD )
View Source
const ( SKM_OK = iota SKM_DUPLICATED SKM_FAILED )
View Source
const (
ShMgrMailboxSize = 1024 * 8 // mailbox size
)
debug
View Source
const (
ShMgrName = sch.ShMgrName // name registered in scheduler
)
chain shell
Variables ¶
View Source
var P2pErrnoDescription = []string{
"none of errors",
"invalid parameters",
"shceduler",
"not implemented",
"internal",
"unknown",
"max value can errno be",
}
Description about user interface errno
Functions ¶
func DhtCommand ¶
execute dht command
func DhtGetManager ¶
get dht manager hosted in a scheduler
func DhtInstallCallback ¶
install callback for dht manager
func DhtRemoveCallback ¶
uninstall callback for dht manager
func P2pCreateInstance ¶
Create p2p instance
func P2pCreateStaticTaskTab ¶
func P2pCreateStaticTaskTab(what P2pType) []sch.TaskStaticDescription
func ShellDefaultBootstrapConfig ¶
get default bootstrap node configuration
func ShellDefaultConfig ¶
Get default configuration
func ShellSetConfig ¶
Set configuration
Types ¶
type DhtShellManager ¶
type DhtShellManager struct {
// contains filtered or unexported fields
}
func (*DhtShellManager) GetConnStatusChan ¶
func (shMgr *DhtShellManager) GetConnStatusChan() chan *sch.MsgDhtConInstStatusInd
func (*DhtShellManager) GetEventChan ¶
func (shMgr *DhtShellManager) GetEventChan() chan *sch.MsgDhtShEventInd
func (*DhtShellManager) TaskProc4Scheduler ¶
func (shMgr *DhtShellManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno
Entry point exported to scheduler
type P2pErrno ¶
type P2pErrno int
errno about this interface
const ( P2pEnoNone P2pErrno = 0 // none of errors P2pEnoParameter P2pErrno = 1 // invalid parameters P2pEnoScheduler P2pErrno = 2 // shceduler P2pEnoNotImpl P2pErrno = 3 // not implemented P2pEnoInternal P2pErrno = 4 // internal P2pEnoUnknown P2pErrno = 5 // unknown P2pEnoMax P2pErrno = 6 // max, for bound checking )
func P2pClosePeer ¶
Close peer
func P2pRegisterCallback ¶
type P2pType ¶
type P2pType = config.P2pAppType
type ShellHsInfo ¶
type ShellManager ¶
type ShellManager struct {
// contains filtered or unexported fields
}
func (*ShellManager) GetActivePeerSnapshot ¶
func (shMgr *ShellManager) GetActivePeerSnapshot() *map[ShellPeerID]ShellPeerSnapshot
func (*ShellManager) GetRxChan ¶
func (shMgr *ShellManager) GetRxChan() chan *peer.P2pPackageRx
func (*ShellManager) TaskProc4Scheduler ¶
func (shMgr *ShellManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno
Entry point exported to scheduler
type ShellPeerID ¶
type ShellPeerID = shellPeerID
type ShellPeerSnapshot ¶
type ShellPeerSnapshot struct { ShellPeerID // shell peer identity HsInfo *peer.Handshake // handshake info about peer Status int // active peer instance status }
Click to show internal directories.
Click to hide internal directories.