node

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

README

veri-node

Documentation

Index

Constants

View Source
const MINGOMAXPROCS = 32

Variables

This section is empty.

Functions

func Find added in v0.0.42

func Find(slice []string, val string) bool

func FirstDifferent added in v0.0.42

func FirstDifferent(list0, list1 []string) string

func GetDataSourceClient

func GetDataSourceClient(p *pb.Peer, name string, idOfPeer string, connectionCache *util.ConnectionCache) data.DataSource

func GetIdOfPeer

func GetIdOfPeer(p *pb.Peer) string

func IsRecent added in v0.0.42

func IsRecent(timestamp uint64) bool

func SerializeStringArray

func SerializeStringArray(list []string) string

Types

type DataSourceClient

type DataSourceClient struct {
	Ids             []string
	Name            string
	IdOfPeer        string
	ConnectionCache *util.ConnectionCache
}

func (*DataSourceClient) GetDataInfo

func (dcs *DataSourceClient) GetDataInfo() *pb.DataInfo

func (*DataSourceClient) GetID

func (dcs *DataSourceClient) GetID() string

func (*DataSourceClient) Insert

func (dcs *DataSourceClient) Insert(datum *pb.Datum, config *pb.InsertConfig) error

func (*DataSourceClient) StreamSearch

func (dcs *DataSourceClient) StreamSearch(datum *pb.Datum, scoredDatumStream chan<- *pb.ScoredDatum, queryWaitGroup *sync.WaitGroup, config *pb.SearchConfig) error

type Node

type Node struct {
	Version         string
	Port            uint32
	Folder          string
	KnownIds        []string
	AdvertisedIds   []string
	Dataset         *data.Dataset
	ServiceList     *cache.Cache
	PeerList        *cache.Cache
	PeriodicTicker  *time.Ticker
	PeriodicDone    chan bool
	QueryUUIDCache  *cache.Cache
	ConnectionCache *util.ConnectionCache
}

func NewNode

func NewNode(config *NodeConfig) *Node

func (*Node) AddPeer

func (n *Node) AddPeer(ctx context.Context, in *pb.AddPeerRequest) (*pb.AddPeerResponse, error)

func (*Node) AddPeerElement added in v0.0.42

func (n *Node) AddPeerElement(peer *pb.Peer) error

func (*Node) AddService

func (n *Node) AddService(service string) error

func (*Node) AddStaticService

func (n *Node) AddStaticService(service string) error

func (*Node) Close added in v0.0.23

func (n *Node) Close() error

func (*Node) CreateDataIfNotExists

func (n *Node) CreateDataIfNotExists(ctx context.Context, in *pb.DataConfig) (*pb.DataInfo, error)

func (*Node) DataStream

func (n *Node) DataStream(getDataRequest *pb.GetDataRequest, stream pb.VeriService_DataStreamServer) error

func (*Node) GetDataInfo

func (n *Node) GetDataInfo(ctx context.Context, getDataRequest *pb.GetDataRequest) (*pb.DataInfo, error)

func (*Node) GetDifferentAddressOf added in v0.0.42

func (n *Node) GetDifferentAddressOf(peer *pb.Peer) string

func (*Node) GetNodeInfo

func (n *Node) GetNodeInfo() *pb.Peer

func (*Node) Info added in v0.0.44

func (n *Node) Info() string

func (*Node) Insert

func (n *Node) Insert(ctx context.Context, insertionRequest *pb.InsertionRequest) (*pb.InsertionResponse, error)

func (*Node) Join

func (n *Node) Join(ctx context.Context, joinRequest *pb.JoinRequest) (*pb.JoinResponse, error)

func (*Node) JoinToPeers

func (n *Node) JoinToPeers() error

func (*Node) Listen

func (n *Node) Listen() error

func (*Node) PeerListItems

func (n *Node) PeerListItems() []*pb.Peer

func (*Node) Periodic

func (n *Node) Periodic() error

func (*Node) Ping added in v0.0.42

func (n *Node) Ping(ctx context.Context, in *pb.PingRequest) (*pb.PingResponse, error)

func (*Node) Search

func (n *Node) Search(ctx context.Context, searchRequest *pb.SearchRequest) (*pb.SearchResponse, error)

func (*Node) SearchStream

func (n *Node) SearchStream(searchRequest *pb.SearchRequest, stream pb.VeriService_SearchStreamServer) error

func (*Node) SendAddPeerRequest added in v0.0.42

func (n *Node) SendAddPeerRequest(id string, peerInfo *pb.Peer) error

func (*Node) SendJoinRequest

func (n *Node) SendJoinRequest(id string) error

func (*Node) SendPingRequest added in v0.0.42

func (n *Node) SendPingRequest(id string) error

func (*Node) ServiceListKeys

func (n *Node) ServiceListKeys() []string

func (*Node) SetPeriodicTask

func (n *Node) SetPeriodicTask()

func (*Node) StopPeriodicTask

func (n *Node) StopPeriodicTask()

func (*Node) SyncWithPeers

func (n *Node) SyncWithPeers()

type NodeConfig

type NodeConfig struct {
	Version       string
	Port          uint32
	Folder        string
	AdvertisedIds []string
	ServiceList   []string
}

Jump to

Keyboard shortcuts

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