Documentation
¶
Index ¶
- type DB
- func (db *DB) ConnectedPeers() []*peer.AddrInfo
- func (db *DB) Disconnect(ctx context.Context) error
- func (db *DB) GetHost() host.Host
- func (db *DB) IsReady() bool
- func (db *DB) Publish(ctx context.Context, topic string, value interface{}) (common.Event, error)
- func (db *DB) Subscribe(ctx context.Context, topic string, handler common.PubSubHandler) error
- func (db *DB) Unsubscribe(ctx context.Context, topic string) error
- type DatabaseInstance
- type DiscoveryService
- func (ds *DiscoveryService) GetConnectedPeers() []peer.AddrInfo
- func (ds *DiscoveryService) GetDHTStats() map[string]interface{}
- func (ds *DiscoveryService) StartDiscovery(ctx context.Context, databaseName string) error
- func (ds *DiscoveryService) StartTopicDiscovery(ctx context.Context, databaseName, topic string) error
- func (ds *DiscoveryService) StopTopicDiscovery(topic string)
- type P2PInfrastructure
- type TopicSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents the main database connection
func (*DB) ConnectedPeers ¶
ConnectedPeers returns information about connected peers
func (*DB) Disconnect ¶
Disconnect closes the database connection and cleans up resources
type DatabaseInstance ¶
type DatabaseInstance struct {
// contains filtered or unexported fields
}
DatabaseInstance represents a database instance with isolated topics
type DiscoveryService ¶
type DiscoveryService struct {
// contains filtered or unexported fields
}
DiscoveryService provides peer discovery functionality
func NewDiscoveryService ¶
NewDiscoveryService creates a new discovery service
func (*DiscoveryService) GetConnectedPeers ¶
func (ds *DiscoveryService) GetConnectedPeers() []peer.AddrInfo
GetConnectedPeers returns information about currently connected peers
func (*DiscoveryService) GetDHTStats ¶
func (ds *DiscoveryService) GetDHTStats() map[string]interface{}
GetDHTStats returns DHT statistics
func (*DiscoveryService) StartDiscovery ¶
func (ds *DiscoveryService) StartDiscovery(ctx context.Context, databaseName string) error
StartDiscovery starts the discovery process for a database
func (*DiscoveryService) StartTopicDiscovery ¶ added in v1.0.6
func (ds *DiscoveryService) StartTopicDiscovery(ctx context.Context, databaseName, topic string) error
StartTopicDiscovery starts topic-specific peer discovery for GossipSub mesh formation
func (*DiscoveryService) StopTopicDiscovery ¶ added in v1.0.6
func (ds *DiscoveryService) StopTopicDiscovery(topic string)
StopTopicDiscovery stops topic-specific peer discovery
type P2PInfrastructure ¶
type P2PInfrastructure struct {
// contains filtered or unexported fields
}
P2PInfrastructure manages the libp2p resources for a single database connection
func (*P2PInfrastructure) IsReady ¶
func (infra *P2PInfrastructure) IsReady() bool
IsReady returns true if the node has at least 1 peer connected
type TopicSubscription ¶
type TopicSubscription struct {
// contains filtered or unexported fields
}
TopicSubscription manages a topic subscription