Documentation
¶
Overview ¶
Package dmsgtest pkg/dmsg/dmsgtest/env.go c1-net-dmsg
Index ¶
- Constants
- type Env
- func (env *Env) AllClients() []*dmsg.Client
- func (env *Env) AllServers() []*dmsg.Server
- func (env *Env) ClientOfPK(pk cipher.PubKey) (*dmsg.Client, bool)
- func (env *Env) CloseAllClients()
- func (env *Env) CloseAllServers()
- func (env *Env) Discovery() disc.APIClient
- func (env *Env) NewClient(conf *dmsg.Config) (*dmsg.Client, error)
- func (env *Env) NewClientWithKeys(pk cipher.PubKey, sk cipher.SecKey, conf *dmsg.Config) (*dmsg.Client, error)
- func (env *Env) NewServer(updateInterval time.Duration) (*dmsg.Server, error)
- func (env *Env) Shutdown()
- func (env *Env) Startup(entryTimeout time.Duration, servers, clients int, conf *dmsg.Config) error
Constants ¶
const DefaultTimeout = time.Minute
DefaultTimeout is the recommended timeout for the Env.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env can run an entire local dmsg environment inclusive of a mock discovery, dmsg servers and clients.
func NewEnv ¶
NewEnv creates a new dmsg environment. The inputs 't' and 'timeout' are optional. If 't' is specified, some log messages are displayed via 't.Log()'. If 'timeout' is not '0', starting entities (such as servers and clients) must complete in the given duration,
otherwise it will fail.
func (*Env) AllClients ¶
AllClients returns all the clients of the Env.
func (*Env) AllServers ¶
AllServers returns all the servers of the Env.
func (*Env) ClientOfPK ¶
ClientOfPK returns client of a given public key.
func (*Env) CloseAllClients ¶
func (env *Env) CloseAllClients()
CloseAllClients closes all clients of the Env.
func (*Env) CloseAllServers ¶
func (env *Env) CloseAllServers()
CloseAllServers closes all servers of the Env.
func (*Env) NewClientWithKeys ¶
func (env *Env) NewClientWithKeys(pk cipher.PubKey, sk cipher.SecKey, conf *dmsg.Config) (*dmsg.Client, error)
NewClientWithKeys runs a new client with specified keys.