Documentation ¶
Index ¶
- func IsFileExist(path string) bool
- func PrintHostAddress(ha host.Host)
- type CRDTKeyValueDB
- func (c *CRDTKeyValueDB) Batch(ctx context.Context) (datastore.Batch, error)
- func (c *CRDTKeyValueDB) Close()
- func (c *CRDTKeyValueDB) Connect(addr string) error
- func (c *CRDTKeyValueDB) DB() *badger2.DB
- func (c *CRDTKeyValueDB) Delete(ctx context.Context, key []byte) error
- func (c *CRDTKeyValueDB) Get(ctx context.Context, key []byte) ([]byte, error)
- func (c *CRDTKeyValueDB) Has(ctx context.Context, key []byte) (bool, error)
- func (c *CRDTKeyValueDB) MarshalPrivateKey() ([]byte, error)
- func (c *CRDTKeyValueDB) Put(ctx context.Context, key, value []byte) error
- func (c *CRDTKeyValueDB) Query(ctx context.Context, q query.Query) (query.Results, error)
- func (c *CRDTKeyValueDB) Repair() error
- func (c *CRDTKeyValueDB) Store() ds.Datastore
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFileExist ¶
func PrintHostAddress ¶
Types ¶
type CRDTKeyValueDB ¶
type CRDTKeyValueDB struct {
// contains filtered or unexported fields
}
func NewCRDTKeyValueDB ¶
func NewCRDTKeyValueDB(ctx context.Context, c Config) (*CRDTKeyValueDB, error)
func (*CRDTKeyValueDB) Batch ¶
func (c *CRDTKeyValueDB) Batch(ctx context.Context) (datastore.Batch, error)
func (*CRDTKeyValueDB) Close ¶
func (c *CRDTKeyValueDB) Close()
func (*CRDTKeyValueDB) Connect ¶
func (c *CRDTKeyValueDB) Connect(addr string) error
func (*CRDTKeyValueDB) DB ¶
func (c *CRDTKeyValueDB) DB() *badger2.DB
func (*CRDTKeyValueDB) Delete ¶
func (c *CRDTKeyValueDB) Delete(ctx context.Context, key []byte) error
func (*CRDTKeyValueDB) MarshalPrivateKey ¶
func (c *CRDTKeyValueDB) MarshalPrivateKey() ([]byte, error)
func (*CRDTKeyValueDB) Put ¶
func (c *CRDTKeyValueDB) Put(ctx context.Context, key, value []byte) error
func (*CRDTKeyValueDB) Repair ¶
func (c *CRDTKeyValueDB) Repair() error
func (*CRDTKeyValueDB) Store ¶
func (c *CRDTKeyValueDB) Store() ds.Datastore
type Config ¶
type Config struct { NodeServiceName string // Service Discovery Identification DataStorePath string // Data storage path DataSyncChannel string // Pubsub data synchronization channel NetDiscoveryChannel string // Node discovery channel PubSubHandleType p2p.PubSubHandleType // PubSub Handle Type - "gossip/flood" PrivateKey []byte // As the private key Namespace string ListenPort string Logger logging.StandardLogger PutHook func(k ds.Key, v []byte) // Peer node data synchronization hook DeleteHook func(k ds.Key) // Peer node data synchronization hook }
Click to show internal directories.
Click to hide internal directories.