Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FatalIfUnexpected ¶
func FatalIfUnexpected(err error)
FatalIfUnexpected calls Log.Fatal(err) unless err is nil, or an error that comes from the net package indicating that the listener was closed or from the Stopper indicating quiescence.
func IsClosedConnection ¶
IsClosedConnection returns true if err is a non-temporary net.Error or is cmux.ErrListenerClosed, grpc.ErrServerStopped, io.EOF, or net.ErrClosed.
Types ¶
type InitialHeartbeatFailedError ¶
type InitialHeartbeatFailedError struct {
WrappedErr error
}
InitialHeartbeatFailedError indicates that while attempting a GRPC connection to a node, we aren't successful and have never seen a heartbeat over that connection before.
func NewInitialHeartBeatFailedError ¶
func NewInitialHeartBeatFailedError(cause error) *InitialHeartbeatFailedError
NewInitialHeartBeatFailedError creates a new InitialHeartbeatFailedError.
func (*InitialHeartbeatFailedError) Cause ¶
func (e *InitialHeartbeatFailedError) Cause() error
Cause implements causer.
func (*InitialHeartbeatFailedError) Error ¶
func (e *InitialHeartbeatFailedError) Error() string
Error implements error.
func (*InitialHeartbeatFailedError) Format ¶
func (e *InitialHeartbeatFailedError) Format(s fmt.State, verb rune)
Format implements fmt.Formatter.
func (*InitialHeartbeatFailedError) FormatError ¶
func (e *InitialHeartbeatFailedError) FormatError(p errors.Printer) error
FormatError implements errors.FormatError.
type Server ¶
Server is a thin wrapper around http.Server. See MakeServer for more detail.
func MakeServer ¶
MakeServer constructs a Server that tracks active connections, closing them when signaled by stopper.
It can serve two different purposes simultaneously:
- to serve as actual HTTP server, using the .Serve(net.Listener) method. - to serve as plain TCP server, using the .ServeWith(...) method.
The latter is used e.g. to accept SQL client connections.
When the HTTP facility is not used, the Go HTTP server object is still used internally to maintain/register the connections via the ConnState() method, for convenience.