shell

package
v0.0.0-...-bd3bf0e Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

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

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

func P2pInit

func P2pInit() sch.SchErrno

Init p2p

func P2pStart

func P2pStart() (sch.SchErrno, *map[string]interface{})

Start p2p

func ShellDefaultConfig

func ShellDefaultConfig() *ycfg.Config

Get default configuration pointer

func ShellGetConfig

func ShellGetConfig() *ycfg.Config

Set configuration

func ShellSetConfig

func ShellSetConfig(cfg *ycfg.Config) ycfg.P2pCfgErrno

Set configuration

Types

type DhtCommandType

type DhtCommandType int

Command type

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 DhtinfChunk

type DhtinfChunk []byte

Chunk

type DhtinfConfirmHandler

type DhtinfConfirmHandler interface {
	DhtCfmCb(ty DhtCommandType, msg interface{}) interface{}
}

Confirm handler interface

type DhtinfId

type DhtinfId uint64

Id

type DhtinfKey

type DhtinfKey []byte

Key

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 P2pInfClosePeer

func P2pInfClosePeer(id *peer.PeerId) P2pInfErrno

Disconnect peer

func P2pInfPoweroff

func P2pInfPoweroff() P2pInfErrno

Free total p2p all

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

Jump to

Keyboard shortcuts

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