db

package
v1.1.1-0...-40efbf4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutBufferSize = 128

OutBufferSize - Out() output go channel buffer size

Functions

This section is empty.

Types

type Node

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

Node : defines an instance of the API with a ql-DB backed Node

func New

func New(contentKey, routingKey bc.KeyPair) *Node

New : creates a new instance of API

func (*Node) AddChannel

func (node *Node) AddChannel(name string, privkey string) error

AddChannel : Add a channel to this node's database

func (*Node) AddChunk

func (node *Node) AddChunk(streamID uint32, chunkNum uint32, data []byte) error

AddChunk - implemented from Node API

func (*Node) AddContact

func (node *Node) AddContact(name string, key string) error

AddContact : Add or Update a contact key to this node's database

func (*Node) AddPeer

func (node *Node) AddPeer(name string, enabled bool, uri string, group ...string) error

AddPeer : Add or Update a peer configuration

func (*Node) AddProfile

func (node *Node) AddProfile(name string, enabled bool) error

AddProfile : Add or Update a profile to this node's database

func (*Node) AddStream

func (node *Node) AddStream(streamID uint32, totalChunks uint32, channelName string) error

AddStream - implemented from Node API

func (*Node) AdminRPC

func (node *Node) AdminRPC(transport api.Transport, call api.RemoteCall) (interface{}, error)

AdminRPC :

func (*Node) BootstrapDB

func (node *Node) BootstrapDB(dbAdapter, dbConnectionString string) db.Session

BootstrapDB - Initialize or open a database file

func (*Node) CID

func (node *Node) CID() (bc.PubKey, error)

CID : Return content key

func (*Node) DeleteChannel

func (node *Node) DeleteChannel(name string) error

DeleteChannel : Remove a channel from this node's database

func (*Node) DeleteContact

func (node *Node) DeleteContact(name string) error

DeleteContact : Remove a contact from this node's database

func (*Node) DeletePeer

func (node *Node) DeletePeer(name string) error

DeletePeer : Remove a peer from this node's database

func (*Node) DeleteProfile

func (node *Node) DeleteProfile(name string) error

DeleteProfile : Remove a profile from this node's database

func (*Node) Dropoff

func (node *Node) Dropoff(bundle api.Bundle) error

Dropoff : Deliver a batch of messages to a remote node

func (*Node) Events

func (node *Node) Events() chan api.Event

Events : Returns the Events channel of this node

func (*Node) Export

func (node *Node) Export() ([]byte, error)

Export : Save a node configuration to a JSON config

func (*Node) FlushOutbox

func (node *Node) FlushOutbox(maxAgeSeconds int64)

FlushOutbox : Deletes outbound messages older than maxAgeSeconds seconds

func (*Node) Forward

func (node *Node) Forward(msg api.Msg) error

Forward - Add an already-encrypted message to the outbound message queue (forward it along)

func (*Node) GetChannel

func (node *Node) GetChannel(name string) (*api.Channel, error)

GetChannel : Return a channel by name

func (*Node) GetChannelPrivKey

func (node *Node) GetChannelPrivKey(name string) (string, error)

GetChannelPrivKey : Return the private key of a given channel

func (*Node) GetChannels

func (node *Node) GetChannels() ([]api.Channel, error)

GetChannels : Return list of channels known to this node

func (*Node) GetContact

func (node *Node) GetContact(name string) (*api.Contact, error)

GetContact : Return a list of keys

func (*Node) GetContacts

func (node *Node) GetContacts() ([]api.Contact, error)

GetContacts : Return a list of keys

func (*Node) GetPeer

func (node *Node) GetPeer(name string) (*api.Peer, error)

GetPeer : Retrieve a peer by name

func (*Node) GetPeers

func (node *Node) GetPeers(group ...string) ([]api.Peer, error)

GetPeers : Retrieve a list of peers in this node's database

func (*Node) GetPolicies

func (node *Node) GetPolicies() []api.Policy

GetPolicies : returns the array of Policy objects for this Node

func (*Node) GetProfile

func (node *Node) GetProfile(name string) (*api.Profile, error)

GetProfile : Retrieve a profiles

func (*Node) GetProfiles

func (node *Node) GetProfiles() ([]api.Profile, error)

GetProfiles : Retrieve the list of profiles for this node

func (*Node) Handle

func (node *Node) Handle(msg api.Msg) (bool, error)

Handle - Decrypt and handle an encrypted message

func (*Node) ID

func (node *Node) ID() (bc.PubKey, error)

ID : Return routing key

func (*Node) Import

func (node *Node) Import(jsonConfig []byte) error

Import : Load a node configuration from a JSON config

func (*Node) In

func (node *Node) In() chan api.Msg

In : Returns the In channel of this node

func (*Node) IsRunning

func (node *Node) IsRunning() bool

IsRunning - returns true if this node is running

func (*Node) LoadProfile

func (node *Node) LoadProfile(name string) (bc.PubKey, error)

LoadProfile : Load a profile key from the database as the content key

func (*Node) Out

func (node *Node) Out() chan api.Msg

Out : Returns the Out channel of this node

func (*Node) Pickup

func (node *Node) Pickup(rpub bc.PubKey, lastTime int64, maxBytes int64, channelNames ...string) (api.Bundle, error)

Pickup : Get messages from a remote node

func (*Node) PublicRPC

func (node *Node) PublicRPC(transport api.Transport, call api.RemoteCall) (interface{}, error)

PublicRPC :

func (*Node) Router

func (node *Node) Router() api.Router

Router : get the Router object for this Node

func (*Node) Send

func (node *Node) Send(contactName string, data []byte, pubkey ...bc.PubKey) error

Send : Transmit a message to a single key

func (*Node) SendBulk

func (node *Node) SendBulk(contactName string, data [][]byte, pubkey ...bc.PubKey) error

SendBulk : Transmit messages to a single key

func (*Node) SendChannel

func (node *Node) SendChannel(channelName string, data []byte, pubkey ...bc.PubKey) error

SendChannel : Transmit a message to a channel

func (*Node) SendChannelBulk

func (node *Node) SendChannelBulk(channelName string, data [][]byte, pubkey ...bc.PubKey) error

SendChannelBulk : Transmit messages to a channel

func (*Node) SendMsg

func (node *Node) SendMsg(msg api.Msg) error

SendMsg : Transmits a message

func (*Node) SetPolicy

func (node *Node) SetPolicy(policies ...api.Policy)

SetPolicy : set the array of Policy objects for this Node

func (*Node) SetRouter

func (node *Node) SetRouter(router api.Router)

SetRouter : set the Router object for this Node

func (*Node) Start

func (node *Node) Start() error

Start : starts the Connection Policy threads

func (*Node) Stop

func (node *Node) Stop()

Stop : sets the isRunning flag to false, indicating that all go routines should end

Jump to

Keyboard shortcuts

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