seedmanager

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const TTL = time.Duration(1 * time.Second)

Variables

This section is empty.

Functions

This section is empty.

Types

type Expiration

type Expiration = int64

type Seed

type Seed = [32]byte

Seed is a type of seed

type SeedGenerator

type SeedGenerator struct {
}

SeedGenerator holds logic with seed generation

func (*SeedGenerator) Next

func (sg *SeedGenerator) Next() (*Seed, error)

Next returns next random seed

type SeedManager

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

SeedManager manages working with seed pool It's thread safe

func New

func New() *SeedManager

New creates new seed manager

func (*SeedManager) Add

func (sm *SeedManager) Add(seed Seed)

Add adds seed to pool

func (*SeedManager) Exists

func (sm *SeedManager) Exists(seed Seed) bool

Exists checks whether seed in the pool

Jump to

Keyboard shortcuts

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