factory

package
v0.0.0-...-c5fb9eb Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGenerateID = errors.New("failed to generate valid id")

Functions

This section is empty.

Types

type Bloom

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

func NewBloom

func NewBloom(name, location string, maxLimit uint, errorRate float64) *Bloom

func (*Bloom) Add

func (b *Bloom) Add(id []byte)

func (*Bloom) Backup

func (b *Bloom) Backup()

func (*Bloom) Exists

func (b *Bloom) Exists(id []byte) bool

func (*Bloom) Restore

func (b *Bloom) Restore() bool

func (*Bloom) TryRestore

func (b *Bloom) TryRestore(restoreFunc func() ([]string, error))

type Factory

type Factory struct {
	ID, Cookie, Token *Bloom
	// contains filtered or unexported fields
}

func New

func New(config *config.FactoryConfig) *Factory

func (*Factory) Backup

func (f *Factory) Backup()

Backup all bloom-filters.

func (*Factory) NewCookie

func (f *Factory) NewCookie() string

func (*Factory) NewID

func (f *Factory) NewID() (string, error)

func (*Factory) Restore

func (f *Factory) Restore(restoreFunc func() ([]string, error))

Restore all bloom-filters.

Jump to

Keyboard shortcuts

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