Documentation ¶
Index ¶
- Constants
- Variables
- func AppendStaticTasks(name string, tep sch.SchUserTaskEp, dcb func(interface{}) sch.SchErrno, ...) sch.SchErrno
- func GetTaskNode(name string) interface{}
- func P2pInfErrnoString(eno P2pInfErrno) string
- func P2pInit() sch.SchErrno
- func P2pStart() (sch.SchErrno, *map[string]interface{})
- func ShellDefaultConfig() *ycfg.Config
- func ShellGetConfig() *ycfg.Config
- func ShellSetConfig(cfg *ycfg.Config) ycfg.P2pCfgErrno
- type DhtCommandType
- type DhtErrno
- type DhtinfChunk
- type DhtinfConfirmHandler
- type DhtinfId
- type DhtinfKey
- type DhtinfRetriveChunkCfm
- type DhtinfRetriveChunkReq
- type DhtinfStoreChunkCfm
- type DhtinfStoreChunkReq
- type P2pInfErrno
Constants ¶
View Source
const ( DHTINF_ENO_NONE = iota DHTINF_ENO_PARA DHTINF_ENO_UNKNOWN DHTINF_ENO_MAX )
DHT errno constants
View Source
const ( DHTINF_CMD_NULL = 0 // null DHTINF_CMD_STORE_REQ = 1 // request to store a chunk DHTINF_CMD_STORE_CFM = 2 // confirm to store chunk request DHTINF_CMD_RETRIVE_REQ = 3 // request to retrive a chunk DHTINF_CMD_RETRIVE_RSP = 4 // confirm to retrive chunk request DHTINF_CMD_MAX = 5 // max, just for bound checking )
Command type constants
View Source
const ( P2pInfIndCb = peer.P2pInfIndCb // callback type for indication P2pInfPkgCb = peer.P2pInfPkgCb // callback type for incoming packages )
View Source
const ( P2pIndPeerActivated = peer.P2pIndPeerActivated // indication for a peer activated to work P2pIndConnStatus = peer.P2pIndConnStatus // indication for peer connection status changed P2pIndPeerClosed = peer.P2pIndPeerClosed // indication for peer connection closed )
Variables ¶
View Source
var P2pInfErrnoDescription = []string{
"none of errors",
"invalid parameters",
"unknown",
"max value can errno be",
}
Description about user interface errno
View Source
var TaskStaticPoweronOrder = []string{ dcv.DcvMgrName, tab.TabMgrName, tab.NdbcName, ngb.LsnMgrName, ngb.NgbMgrName, peer.PeerMgrName, peer.PeerLsnMgrName, dht.DhtMgrName, dhtro.DhtroMgrName, dhtch.DhtchMgrName, dhtre.DhtreMgrName, dhtst.DhtstMgrName, dhtsy.DhtsyMgrName, }
Poweron order of static user tasks
View Source
var TaskStaticTab = []sch.TaskStaticDescription{ {Name: dcv.DcvMgrName, Tep: dcv.DcvMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: tab.TabMgrName, Tep: tab.TabMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: tab.NdbcName, Tep: tab.NdbcProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: ngb.LsnMgrName, Tep: ngb.LsnMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: ngb.NgbMgrName, Tep: ngb.NgbMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: peer.PeerLsnMgrName, Tep: peer.LsnMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: peer.PeerMgrName, Tep: peer.PeerMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: dht.DhtMgrName, Tep: dht.DhtMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: dhtro.DhtroMgrName, Tep: dhtro.DhtroMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: dhtch.DhtchMgrName, Tep: dhtch.DhtchMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: dhtre.DhtreMgrName, Tep: dhtre.DhtreMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: dhtst.DhtstMgrName, Tep: dhtst.DhtstMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, {Name: dhtsy.DhtsyMgrName, Tep: dhtsy.DhtsyMgrProc, MbSize: -1, DieCb: nil, Wd: noDog, Flag: sch.SchCreatedSuspend}, }
Functions ¶
func AppendStaticTasks ¶
func AppendStaticTasks( name string, tep sch.SchUserTaskEp, dcb func(interface{}) sch.SchErrno, dog sch.SchWatchDog) sch.SchErrno
Append a static user task to table TaskStaticTab
func GetTaskNode ¶
func GetTaskNode(name string) interface{}
Get user static task pointer: this pointer would be required when accessing to scheduler, see file schinf.go for more please.
func P2pInfErrnoString ¶
func P2pInfErrnoString(eno P2pInfErrno) string
Stringz an errno with an eno parameter
Types ¶
type DhtErrno ¶
type DhtErrno int
DHT errno type
func DhtinfRegisterConfirmHandler ¶
func DhtinfRegisterConfirmHandler(h DhtinfConfirmHandler) DhtErrno
Register confirm handler
func DhtinfRetriveChunk ¶
func DhtinfRetriveChunk(req *DhtinfRetriveChunkReq) DhtErrno
Request to retrive a chunk
func DhtinfStoreChunk ¶
func DhtinfStoreChunk(req *DhtinfStoreChunkReq) DhtErrno
Request to store a chunk
type DhtinfConfirmHandler ¶
type DhtinfConfirmHandler interface {
DhtCfmCb(ty DhtCommandType, msg interface{}) interface{}
}
Confirm handler interface
type DhtinfRetriveChunkCfm ¶
type DhtinfRetriveChunkCfm struct { Key DhtinfKey // key for chunk wanted Chunk DhtinfChunk // the chunk data Id DhtinfId // identity obtained by DhtinfRetriveChunkReq.Id }
Confirm to retrive a chunk
type DhtinfRetriveChunkReq ¶
type DhtinfRetriveChunkReq struct { Key DhtinfKey // key for chunk wanted Id DhtinfId // identity for this request }
Request to retrive a chunk
type DhtinfStoreChunkCfm ¶
type DhtinfStoreChunkCfm struct { Key DhtinfKey // key for the chunk data Id DhtinfId // identity obtained by DhtinfStoreChunkReq.Id }
Confirm to sotre a chunk
type DhtinfStoreChunkReq ¶
type DhtinfStoreChunkReq struct { Key DhtinfKey // key for the chunk data Chunk DhtinfChunk // the chunk data Id DhtinfId // identity for this request }
Request to store a chunk
type P2pInfErrno ¶
type P2pInfErrno int
errno about this interface
const ( P2pInfEnoNone P2pInfErrno = 0 // none of errors P2pInfEnoParameter P2pInfErrno = 1 // invalid parameters P2pInfEnoScheduler P2pInfErrno = 2 // shceduler P2pInfEnoNotImpl P2pInfErrno = 3 // not implemented P2pInfEnoInternal P2pInfErrno = 4 // internal P2pInfEnoUnknown P2pInfErrno = 5 // unknown P2pInfEnoMax P2pInfErrno = 6 // max, for bound checking )
func P2pInfRegisterCallback ¶
func P2pInfRegisterCallback(what int, cb interface{}, ptn interface{}) P2pInfErrno
func P2pInfSendPackage ¶
func P2pInfSendPackage(pkg *peer.P2pPackage2Peer) P2pInfErrno
Send message to peer
func (P2pInfErrno) P2pInfErrnoString ¶
func (eno P2pInfErrno) P2pInfErrnoString() string
Stringz an errno with itself
Click to show internal directories.
Click to hide internal directories.