dnm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeRecordSys

type NodeRecordSys struct {
	Db       *uleveldb.ULevelDB
	RN       map[string]*dagNodeInfo
	NodeLock sync.Mutex
}

NodeRecordSys is a struct for record the dag node

func NewRecordSys

func NewRecordSys(db *uleveldb.ULevelDB) *NodeRecordSys

NewRecordSys create a new record system

func (*NodeRecordSys) Add

func (r *NodeRecordSys) Add(cid string, name string) error

Add a new record

func (*NodeRecordSys) Get

func (r *NodeRecordSys) Get(cid string) (string, error)

Get a record by cid

func (*NodeRecordSys) GetCanUseNode

func (r *NodeRecordSys) GetCanUseNode() string

GetCanUseNode get the can use node

func (*NodeRecordSys) GetNameUseIp

func (r *NodeRecordSys) GetNameUseIp(ip string) (string, error)

GetNameUseIp get the name by ip

func (*NodeRecordSys) HandleDagNode

func (r *NodeRecordSys) HandleDagNode(cons []*datanode.Client, name string) error

HandleDagNode handle the dag node

func (*NodeRecordSys) Remove

func (r *NodeRecordSys) Remove(name, dataName string)

Remove a record

Jump to

Keyboard shortcuts

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