rpc

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rpc implements the rpc layer for the bloomfilter, following the principles from https://golang.org/pkg/net/rpc

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBloomfilterInitialized = fmt.Errorf("Bloomfilter not initialized")
)

ErrNoBloomfilterInitialized error

Functions

This section is empty.

Types

type AddInput

type AddInput struct {
	Elems [][]byte
}

AddInput type for an array of elements

type AddOutput

type AddOutput struct {
	Count int
}

AddOutput type for an array of elements to a sliding bloomfilter set

type Bloomfilter

type Bloomfilter struct {
	BloomfilterRPC
}

Bloomfilter wrapper for BloomfilterRPC type

func New

func New(ctx context.Context, cfg Config) *Bloomfilter

New rpc layer implementation of creating a sliding bloomfilter set

func (Bloomfilter) Bloomfilter

func (Bloomfilter) Bloomfilter() *rotate.Bloomfilter

Bloomfilter getter

func (Bloomfilter) Close

func (Bloomfilter) Close()

Close sliding bloomfilter set

type BloomfilterRPC

type BloomfilterRPC int

BloomfilterRPC type

func (BloomfilterRPC) Add

func (BloomfilterRPC) Add(in AddInput, out *AddOutput) error

Add rpc layer implementation of an array of elements to a sliding bloomfilter set

func (BloomfilterRPC) Check

func (BloomfilterRPC) Check(in CheckInput, out *CheckOutput) error

Check rpc layer implementation of an array of elements in a sliding bloomfilter set

func (BloomfilterRPC) Union

func (BloomfilterRPC) Union(in UnionInput, out *UnionOutput) error

Union rpc layer implementation of two sliding bloomfilter sets

type CheckInput

type CheckInput struct {
	Elems [][]byte
}

CheckInput type for an array of elements

type CheckOutput

type CheckOutput struct {
	Checks []bool
}

CheckOutput type for check result of an array of elements in a sliding bloomfilter set

type Config

type Config struct {
	rotate.Config
	Port int `json:"port"`
}

Config type containing a sliding bloomfilter set and a port

type UnionInput

type UnionInput struct {
	BF *rotate.Bloomfilter
}

UnionInput type for sliding bloomfilter set

type UnionOutput

type UnionOutput struct {
	Capacity float64
}

UnionOutput type for sliding bloomfilter set fill degree

Directories

Path Synopsis
Package client implements an rpc client for the bloomfilter, along with Add and Check methods.
Package client implements an rpc client for the bloomfilter, along with Add and Check methods.
Package server implements an rpc server for the bloomfilter, registering a bloomfilter and accepting a tcp listener.
Package server implements an rpc server for the bloomfilter, registering a bloomfilter and accepting a tcp listener.

Jump to

Keyboard shortcuts

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