mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Adds an RPC endpoint injection method for testing.
This commit is contained in:
parent
7af41edf52
commit
5d06a87d82
@ -689,6 +689,12 @@ func (s *Server) RPC(method string, args interface{}, reply interface{}) error {
|
||||
return codec.err
|
||||
}
|
||||
|
||||
// InjectEndpoint is used to substitute an endpoint for testing.
|
||||
func (s *Server) InjectEndpoint(endpoint interface{}) error {
|
||||
s.logger.Printf("[WARN] consul: endpoint injected; this should only be used for testing")
|
||||
return s.rpcServer.Register(endpoint)
|
||||
}
|
||||
|
||||
// Stats is used to return statistics for debugging and insight
|
||||
// for various sub-systems
|
||||
func (s *Server) Stats() map[string]map[string]string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user