database

package
v0.0.0-...-6215ed3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	ConnectionString string
	URI              string
	CachePath        string
	Cache            *cache.Cache

	Logger *zap.Logger

	IPFSNode    *core.IpfsNode
	IPFSCoreAPI icore.CoreAPI

	OrbitDB orbitdb.OrbitDB
	Store   orbitdb.DocumentStore
	Events  event.Subscription
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(
	ctx context.Context,
	dbConnectionString string,
	dbCache string,
	cch *cache.Cache,
	logger *zap.Logger,
) (*Database, error)

func (*Database) Connect

func (db *Database) Connect(onReady func(address string)) error

func (*Database) Disconnect

func (db *Database) Disconnect()

func (*Database) GetDataByID

func (db *Database) GetDataByID(id string) (models.Data, error)

func (*Database) GetOwnID

func (db *Database) GetOwnID() string

func (*Database) GetOwnPubKey

func (db *Database) GetOwnPubKey() crypto.PubKey

func (*Database) SubmitData

func (db *Database) SubmitData(article *models.Data) error

Jump to

Keyboard shortcuts

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