Documentation ¶
Overview ¶
Package test offers some common functionalities that are used throughout many different tests in drand.
Index ¶
- func Addresses(n int) []string
- func BatchIdentities(n int) ([]*key.Pair, *key.Group)
- func BatchTLSIdentities(n int) ([]*key.Pair, *key.Group)
- func FreeBind(a string) string
- func FreePort() string
- func GenerateIDs(n int) []*key.Pair
- func ListFromPrivates(keys []*key.Pair) []*key.Node
- func LocalHost() string
- func NewKeyStore() key.Store
- func NewPeer(addr string) net.Peer
- func NewTLSPeer(addr string) net.Peer
- func Ports(n int) []string
- func StringToPoint(s string) (kyber.Point, error)
- type KeyStore
- func (k *KeyStore) LoadDistPublic() (*key.DistPublic, error)
- func (k *KeyStore) LoadGroup() (*key.Group, error)
- func (k *KeyStore) LoadKeyPair() (*key.Pair, error)
- func (k *KeyStore) LoadShare() (*key.Share, error)
- func (k *KeyStore) Reset(...key.ResetOption) error
- func (k *KeyStore) SaveDistPublic(d *key.DistPublic) error
- func (k *KeyStore) SaveGroup(g *key.Group) error
- func (k *KeyStore) SaveKeyPair(p *key.Pair) error
- func (k *KeyStore) SaveShare(share *key.Share) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Addresses ¶
Addresses returns a list of TCP localhost addresses starting from the given port= start.
func BatchIdentities ¶
BatchIdentities generates n insecure identities
func BatchTLSIdentities ¶ added in v0.3.7
BatchTLSIdentities generates n secure (TLS) identities
func FreePort ¶
func FreePort() string
FreePort returns an free TCP port. Taken from https://github.com/phayes/freeport/blob/master/freeport.go
func GenerateIDs ¶
GenerateIDs returns n keys with random port localhost addresses
func ListFromPrivates ¶
ListFromPrivates returns a list of Identity from a list of Pair keys.
func LocalHost ¶ added in v1.1.2
func LocalHost() string
LocalHost returns the default local bind address: e.g. [::] or 127.0.0.1
func NewKeyStore ¶
func NewTLSPeer ¶ added in v0.3.7
NewTLSPeer returns a new net.Peer with TLS enabled
Types ¶
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
func (*KeyStore) LoadDistPublic ¶
func (k *KeyStore) LoadDistPublic() (*key.DistPublic, error)
func (*KeyStore) SaveDistPublic ¶
func (k *KeyStore) SaveDistPublic(d *key.DistPublic) error