test

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

test package offers some common functionalities that are used throughout many different tests in drand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addresses

func Addresses(n int) []string

Addresses returns a list of TCP localhost addresses starting from the given port= start.

func BatchIdentities

func BatchIdentities(n int) ([]*key.Private, *key.Group)

func FreePort

func FreePort() int

GetFreePort returns an free TCP port. Taken from https://github.com/phayes/freeport/blob/master/freeport.go

func GenerateIDs

func GenerateIDs(n int) []*key.Private

GenerateIDs returns n keys with random port localhost addresses

func ListFromPrivates

func ListFromPrivates(keys []*key.Private) []*key.Identity

ListFromPrivates returns a list of Identity from a list of Private keys.

func NewKeyStore

func NewKeyStore() key.Store

Types

type KeyStore

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

func (*KeyStore) LoadDistPublic

func (k *KeyStore) LoadDistPublic() (*key.DistPublic, error)

func (*KeyStore) LoadGroup

func (k *KeyStore) LoadGroup() (*key.Group, error)

func (*KeyStore) LoadPrivate

func (k *KeyStore) LoadPrivate() (*key.Private, error)

func (*KeyStore) LoadShare

func (k *KeyStore) LoadShare() (*key.Share, error)

func (*KeyStore) SaveDistPublic

func (k *KeyStore) SaveDistPublic(d *key.DistPublic) error

func (*KeyStore) SaveGroup

func (k *KeyStore) SaveGroup(g *key.Group) error

func (*KeyStore) SavePrivate

func (k *KeyStore) SavePrivate(p *key.Private) error

func (*KeyStore) SaveShare

func (k *KeyStore) SaveShare(share *key.Share) error

Jump to

Keyboard shortcuts

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