Documentation ¶
Index ¶
- Constants
- Variables
- func IsDeprecatedNode(ni *coredbpb.NodeInfo) bool
- func IsNodesVersionUpdated(ni *coredbpb.NodeInfo) bool
- type CoreDB
- func (db *CoreDB) AddLogInfo(ctx context.Context, loginfo *jarviscorepb.LogInfo) error
- func (db *CoreDB) AddTask(ctx context.Context, task *jarviscorepb.JarvisTask) error
- func (db *CoreDB) Close()
- func (db *CoreDB) CountMyNodesVersion() string
- func (db *CoreDB) CountNodeNums() int
- func (db *CoreDB) DelLogInfo(ctx context.Context, loginfo *jarviscorepb.LogInfo) error
- func (db *CoreDB) FindMapNode(name string) *coredbpb.NodeInfo
- func (db *CoreDB) FindNodeWithServAddr(servaddr string) *coredbpb.NodeInfo
- func (db *CoreDB) ForEachMapNodes(oneach func(string, *coredbpb.NodeInfo) error) error
- func (db *CoreDB) GetAllLogInfos(ctx context.Context) ([]*jarviscorepb.LogInfo, error)
- func (db *CoreDB) GetAppLogInfos(ctx context.Context, appName string) ([]*jarviscorepb.LogInfo, error)
- func (db *CoreDB) GetCurRecvMsgID(addr string) int64
- func (db *CoreDB) GetMyData() (*coredbpb.PrivateData, error)
- func (db *CoreDB) GetNewSendMsgID(addr string) int64
- func (db *CoreDB) GetNode(addr string) *coredbpb.NodeInfo
- func (db *CoreDB) GetNodes(nums int) (*coredbpb.NodeInfoList, error)
- func (db *CoreDB) GetPrivateKey() *jarviscrypto.PrivateKey
- func (db *CoreDB) Init() error
- func (db *CoreDB) IsTrustNode(addr string) bool
- func (db *CoreDB) OnIConnectedNode(ni *jarviscorepb.NodeBaseInfo) error
- func (db *CoreDB) OnNodeConnected(ni *jarviscorepb.NodeBaseInfo) error
- func (db *CoreDB) SetLastNodesVersion(addr string, nodesVersion string) error
- func (db *CoreDB) SetNodesVersion(addr string, nodesVersion string) error
- func (db *CoreDB) Start(ctx context.Context) error
- func (db *CoreDB) TrustNode(addr string) error
- func (db *CoreDB) TrustNodes(lstNode []string) error
- func (db *CoreDB) UpdMsgID(addr string, sendmsgid int64, recvmsgid int64)
- func (db *CoreDB) UpdNodeBaseInfo(ni *jarviscorepb.NodeBaseInfo) error
- func (db *CoreDB) UpdNodeInfo(addr string) error
- func (db *CoreDB) UpdRecvMsgID(addr string, msgid int64)
- func (db *CoreDB) UpdSendMsgID(addr string, msgid int64)
Constants ¶
const CoreDBName = "coredb"
CoreDBName - coredb name
Variables ¶
var ( // ErrNoPrivateKey - no private key ErrNoPrivateKey = errors.New("no private key") // ErrCoreDBHasNotNode - coredb has not node ErrCoreDBHasNotNode = errors.New("coredb has not node") )
Functions ¶
func IsDeprecatedNode ¶ added in v0.7.130
IsDeprecatedNode - is a deprecated node?
func IsNodesVersionUpdated ¶ added in v0.7.208
IsNodesVersionUpdated - check nodesVersion
Types ¶
type CoreDB ¶ added in v0.7.130
type CoreDB struct {
// contains filtered or unexported fields
}
CoreDB - jarvisnode core database
func (*CoreDB) AddLogInfo ¶ added in v0.7.211
AddLogInfo - add loginfo
func (*CoreDB) AddTask ¶ added in v0.7.178
func (db *CoreDB) AddTask(ctx context.Context, task *jarviscorepb.JarvisTask) error
AddTask - add task
func (*CoreDB) CountMyNodesVersion ¶ added in v0.7.208
CountMyNodesVersion - count my nodes version
func (*CoreDB) CountNodeNums ¶ added in v0.7.130
CountNodeNums - count all node nums
func (*CoreDB) DelLogInfo ¶ added in v0.7.211
DelLogInfo - del loginfo
func (*CoreDB) FindMapNode ¶ added in v0.7.130
FindMapNode - find node in mapNodes
func (*CoreDB) FindNodeWithServAddr ¶ added in v0.7.130
FindNodeWithServAddr - get node
func (*CoreDB) ForEachMapNodes ¶ added in v0.7.130
ForEachMapNodes - foreach mapNodes
func (*CoreDB) GetAllLogInfos ¶ added in v0.7.211
GetAllLogInfos - get loginfo
func (*CoreDB) GetAppLogInfos ¶ added in v0.7.211
func (db *CoreDB) GetAppLogInfos(ctx context.Context, appName string) ([]*jarviscorepb.LogInfo, error)
GetAppLogInfos - get app loginfo
func (*CoreDB) GetCurRecvMsgID ¶ added in v0.7.130
GetCurRecvMsgID - get msgid
func (*CoreDB) GetMyData ¶ added in v0.7.130
func (db *CoreDB) GetMyData() (*coredbpb.PrivateData, error)
GetMyData - get my state
func (*CoreDB) GetNewSendMsgID ¶ added in v0.7.130
GetNewSendMsgID - get msgid
func (*CoreDB) GetNodes ¶ added in v0.7.130
func (db *CoreDB) GetNodes(nums int) (*coredbpb.NodeInfoList, error)
GetNodes - get jarvis nodes
func (*CoreDB) GetPrivateKey ¶ added in v0.7.130
func (db *CoreDB) GetPrivateKey() *jarviscrypto.PrivateKey
GetPrivateKey -
func (*CoreDB) IsTrustNode ¶ added in v0.7.130
IsTrustNode - is trust node with addr
func (*CoreDB) OnIConnectedNode ¶ added in v0.7.208
func (db *CoreDB) OnIConnectedNode(ni *jarviscorepb.NodeBaseInfo) error
OnIConnectedNode -
func (*CoreDB) OnNodeConnected ¶ added in v0.7.208
func (db *CoreDB) OnNodeConnected(ni *jarviscorepb.NodeBaseInfo) error
OnNodeConnected -
func (*CoreDB) SetLastNodesVersion ¶ added in v0.7.208
SetLastNodesVersion - set last nodes version
func (*CoreDB) SetNodesVersion ¶ added in v0.7.208
SetNodesVersion - set nodes version
func (*CoreDB) TrustNodes ¶ added in v0.7.130
TrustNodes - trust some nodes
func (*CoreDB) UpdNodeBaseInfo ¶ added in v0.7.130
func (db *CoreDB) UpdNodeBaseInfo(ni *jarviscorepb.NodeBaseInfo) error
UpdNodeBaseInfo -
func (*CoreDB) UpdNodeInfo ¶ added in v0.7.130
UpdNodeInfo -
func (*CoreDB) UpdRecvMsgID ¶ added in v0.7.130
UpdRecvMsgID - update msgid
func (*CoreDB) UpdSendMsgID ¶ added in v0.7.130
UpdSendMsgID - update msgid