Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Listener ¶
type Listener interface { net.Listener Dial(address string, timeout time.Duration) (net.Conn, error) }
Listener is the interface Raft-compatible network layers should implement.
type RootHandler ¶
type RootHandler struct { S *Server // contains filtered or unexported fields }
func (*RootHandler) ServeHTTP ¶
func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TransportDelegate ¶
type TransportDelegate struct {
// contains filtered or unexported fields
}
Transport is the network service provided to Raft, and wraps a Listener.
func NewTransportDelegate ¶
func NewTransportDelegate(ln Listener) *TransportDelegate
NewTransport returns an initialized Transport.
func (*TransportDelegate) Accept ¶
func (t *TransportDelegate) Accept() (net.Conn, error)
Accept waits for the next connection.
func (*TransportDelegate) Addr ¶
func (t *TransportDelegate) Addr() net.Addr
Addr returns the binding address of the transport.
func (*TransportDelegate) Close ¶
func (t *TransportDelegate) Close() error
Close closes the transport
func (*TransportDelegate) Dial ¶
func (t *TransportDelegate) Dial(addr raft.ServerAddress, timeout time.Duration) (net.Conn, error)
Dial creates a new network connection.
Click to show internal directories.
Click to hide internal directories.