db

package
v0.0.0-...-95c1484 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug     bool
	CachePath string
}

Config specifies service settings.

type DB

type DB interface {
	// ID returns the DB ID
	ID() string

	// PublicProfile gets the Specter public profile
	PublicProfile() (PublicProfile, error)

	// Close closes the connections of DB
	Close() error
}

DB is an interface for specter storage

func NewOrbitDB

func NewOrbitDB(ctx context.Context, ipfsNode ipfs.Node, config Config) (DB, error)

NewOrbitDB creates a new instance of OrbitDB

type OrbitDB

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

OrbitDB is an instance of a OrbitDB database

func (*OrbitDB) Close

func (db *OrbitDB) Close() error

Close closes the connections of OrbitDB

func (*OrbitDB) ID

func (db *OrbitDB) ID() string

ID returns the DB ID

func (*OrbitDB) PublicProfile

func (db *OrbitDB) PublicProfile() (PublicProfile, error)

PublicProfile gets the Specter PublicProfileOrbitDB

type PublicProfile

type PublicProfile interface {
	// Address Returns the address for the current store
	Address() string

	// All Returns a consolidated key value map from the entries of this store
	All() map[string][]byte

	// Put Sets the value for a key of the map
	Put(key string, value []byte) error

	// Delete Clears the value for a key of the map
	Delete(key string) error

	// Get Retrieves the value for a key of the map
	Get(key string) ([]byte, error)

	// Close closes the connections of DB
	Close() error
}

PublicProfile is an interface for the Specter public profile

type PublicProfileOrbitDB

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

PublicProfileOrbitDB is an instance of a PublicProfile database

func (*PublicProfileOrbitDB) Address

func (db *PublicProfileOrbitDB) Address() string

Address Returns the address for the current store

func (*PublicProfileOrbitDB) All

func (db *PublicProfileOrbitDB) All() map[string][]byte

All Returns a consolidated key value map from the entries of this store

func (*PublicProfileOrbitDB) Close

func (db *PublicProfileOrbitDB) Close() error

Close closes the connections of PublicProfileOrbitDB

func (*PublicProfileOrbitDB) Delete

func (db *PublicProfileOrbitDB) Delete(key string) error

Delete Clears the value for a key of the map

func (*PublicProfileOrbitDB) Get

func (db *PublicProfileOrbitDB) Get(key string) ([]byte, error)

Get Retrieves the value for a key of the map

func (*PublicProfileOrbitDB) Put

func (db *PublicProfileOrbitDB) Put(key string, value []byte) error

Put Sets the value for a key of the map

Jump to

Keyboard shortcuts

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