Documentation ¶
Index ¶
- Variables
- func AddFriend(nodeID [32]byte, remark string)
- func AddP2PMessageEvent(sessionID [32]byte, event types.P2PMessageEvent)
- func DeleteFriend(nodeID [32]byte)
- func GetFriendIDs() [][32]byte
- func GetFriends() map[[32]byte]friendInfo
- func GetP2PSession(sessionID [32]byte) *p2pSession
- func GetP2PSessions() []*p2pSession
- func HasFriend(nodeID [32]byte) bool
- func Init(path string, localNodeID [32]byte)
- func NotateP2PSession(sessionID [32]byte, userID enode.ID, pubkey *ecdsa.PublicKey)
- func PutP2PSession(sessionID [32]byte, session *p2pSession)
- type Database
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDBNotInit = errors.New("database not initialize")
Functions ¶
func AddP2PMessageEvent ¶
func AddP2PMessageEvent(sessionID [32]byte, event types.P2PMessageEvent)
Add appends p2p message event into session, creates session if not exists.
func DeleteFriend ¶
func DeleteFriend(nodeID [32]byte)
func GetFriends ¶
func GetFriends() map[[32]byte]friendInfo
Get all friends info. Returns nil if any error occurs
func GetP2PSession ¶
func GetP2PSession(sessionID [32]byte) *p2pSession
Get specific p2p session. Returns nil if any error occurs
func GetP2PSessions ¶
func GetP2PSessions() []*p2pSession
Get all p2p sessions. Returns nil if any error occurs
func NotateP2PSession ¶
func PutP2PSession ¶
func PutP2PSession(sessionID [32]byte, session *p2pSession)
Types ¶
Click to show internal directories.
Click to hide internal directories.