client

package
v0.0.0-...-832417e Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerDataStore

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

func NewBadgerDataStore

func NewBadgerDataStore(dsPath string, encKey []byte) (*BadgerDataStore, error)

func (*BadgerDataStore) Close

func (ds *BadgerDataStore) Close() error

func (*BadgerDataStore) Delete

func (ds *BadgerDataStore) Delete(key []byte) error

func (*BadgerDataStore) Get

func (ds *BadgerDataStore) Get(key []byte) ([]byte, error)

func (*BadgerDataStore) ListPrefix

func (ds *BadgerDataStore) ListPrefix(prefix []byte) ([][]byte, error)

func (*BadgerDataStore) Put

func (ds *BadgerDataStore) Put(key []byte, value []byte) error

type Client

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

func NewClient

func NewClient(configPath string) (*Client, error)

func (*Client) Addrs

func (c *Client) Addrs() []string

func (*Client) Advertise

func (c *Client) Advertise(serviceName string)

func (*Client) Bootstrap

func (c *Client) Bootstrap() error

func (*Client) Close

func (c *Client) Close() error

func (*Client) FindPeers

func (c *Client) FindPeers(serviceName string) (<-chan peer.AddrInfo, error)

func (*Client) GetConfig

func (c *Client) GetConfig() *config.HostConfig

func (*Client) ID

func (c *Client) ID() string

func (*Client) Peers

func (c *Client) Peers() []peer.ID

type DataStore

type DataStore interface {
	Put(key []byte, value []byte) error
	Get(key []byte) ([]byte, error)
	Delete(key []byte) error
	// ListPrefix(prefix []byte) error
	Close() error
}

Jump to

Keyboard shortcuts

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