database

package
v1.5.14 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IKVDatabase added in v1.5.10

type IKVDatabase interface {
	types.ICloser

	Size(IRelation) uint64
	Push(IRelation, IMessage) error
	Load(IRelation, uint64, uint64) ([]IMessage, error)
}

func NewKeyValueDB

func NewKeyValueDB(pPath string, pKey []byte) (IKVDatabase, error)

type IMessage

type IMessage interface {
	IsIncoming() bool
	GetSHA256UID() string
	GetMessage() []byte
	GetTimestamp() string
	ToBytes() []byte
}

func LoadMessage

func LoadMessage(pMsgBytes []byte) IMessage

func NewMessage

func NewMessage(pIsIncoming bool, pMessage []byte, pHashUID []byte) IMessage

type IRelation

type IRelation interface {
	IAm() asymmetric.IPubKey
	Friend() asymmetric.IPubKey
}

func NewRelation

func NewRelation(pIAm, pFriend asymmetric.IPubKey) IRelation

type IWrapperDB

type IWrapperDB interface {
	types.ICloser

	Get() IKVDatabase
	Set(IKVDatabase) IWrapperDB
}

func NewWrapperDB

func NewWrapperDB() IWrapperDB

Jump to

Keyboard shortcuts

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