coredb

package
v0.7.212 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CoreDBName = "coredb"

CoreDBName - coredb name

Variables

View Source
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

func IsDeprecatedNode(ni *coredbpb.NodeInfo) bool

IsDeprecatedNode - is a deprecated node?

func IsNodesVersionUpdated added in v0.7.208

func IsNodesVersionUpdated(ni *coredbpb.NodeInfo) bool

IsNodesVersionUpdated - check nodesVersion

Types

type CoreDB added in v0.7.130

type CoreDB struct {
	// contains filtered or unexported fields
}

CoreDB - jarvisnode core database

func NewCoreDB

func NewCoreDB(dbpath string, httpAddr string, engine string, lstTrust []string) (*CoreDB, error)

NewCoreDB -

func (*CoreDB) AddLogInfo added in v0.7.211

func (db *CoreDB) AddLogInfo(ctx context.Context, loginfo *jarviscorepb.LogInfo) error

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) Close added in v0.7.130

func (db *CoreDB) Close()

Close - close database

func (*CoreDB) CountMyNodesVersion added in v0.7.208

func (db *CoreDB) CountMyNodesVersion() string

CountMyNodesVersion - count my nodes version

func (*CoreDB) CountNodeNums added in v0.7.130

func (db *CoreDB) CountNodeNums() int

CountNodeNums - count all node nums

func (*CoreDB) DelLogInfo added in v0.7.211

func (db *CoreDB) DelLogInfo(ctx context.Context, loginfo *jarviscorepb.LogInfo) error

DelLogInfo - del loginfo

func (*CoreDB) FindMapNode added in v0.7.130

func (db *CoreDB) FindMapNode(name string) *coredbpb.NodeInfo

FindMapNode - find node in mapNodes

func (*CoreDB) FindNodeWithServAddr added in v0.7.130

func (db *CoreDB) FindNodeWithServAddr(servaddr string) *coredbpb.NodeInfo

FindNodeWithServAddr - get node

func (*CoreDB) ForEachMapNodes added in v0.7.130

func (db *CoreDB) ForEachMapNodes(oneach func(string, *coredbpb.NodeInfo) error) error

ForEachMapNodes - foreach mapNodes

func (*CoreDB) GetAllLogInfos added in v0.7.211

func (db *CoreDB) GetAllLogInfos(ctx context.Context) ([]*jarviscorepb.LogInfo, error)

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

func (db *CoreDB) GetCurRecvMsgID(addr string) int64

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

func (db *CoreDB) GetNewSendMsgID(addr string) int64

GetNewSendMsgID - get msgid

func (*CoreDB) GetNode added in v0.7.130

func (db *CoreDB) GetNode(addr string) *coredbpb.NodeInfo

GetNode - get node with addr

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) Init added in v0.7.130

func (db *CoreDB) Init() error

Init -

func (*CoreDB) IsTrustNode added in v0.7.130

func (db *CoreDB) IsTrustNode(addr string) bool

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

func (db *CoreDB) SetLastNodesVersion(addr string, nodesVersion string) error

SetLastNodesVersion - set last nodes version

func (*CoreDB) SetNodesVersion added in v0.7.208

func (db *CoreDB) SetNodesVersion(addr string, nodesVersion string) error

SetNodesVersion - set nodes version

func (*CoreDB) Start added in v0.7.130

func (db *CoreDB) Start(ctx context.Context) error

Start - start

func (*CoreDB) TrustNode added in v0.7.130

func (db *CoreDB) TrustNode(addr string) error

TrustNode - trust node with addr

func (*CoreDB) TrustNodes added in v0.7.130

func (db *CoreDB) TrustNodes(lstNode []string) error

TrustNodes - trust some nodes

func (*CoreDB) UpdMsgID added in v0.7.130

func (db *CoreDB) UpdMsgID(addr string, sendmsgid int64, recvmsgid int64)

UpdMsgID - update msgid

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

func (db *CoreDB) UpdNodeInfo(addr string) error

UpdNodeInfo -

func (*CoreDB) UpdRecvMsgID added in v0.7.130

func (db *CoreDB) UpdRecvMsgID(addr string, msgid int64)

UpdRecvMsgID - update msgid

func (*CoreDB) UpdSendMsgID added in v0.7.130

func (db *CoreDB) UpdSendMsgID(addr string, msgid int64)

UpdSendMsgID - update msgid

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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