Documentation ¶
Index ¶
- Constants
- Variables
- func Dial(network string, address string, stream byte) (net.Conn, error)
- func DialContext(ctx context.Context, network string, address string, stream byte) (net.Conn, error)
- func DialContextTLS(ctx context.Context, network string, address string, stream byte, ...) (net.Conn, error)
- func DialTLS(network string, address string, stream byte, config *tls.Config) (net.Conn, error)
- func NewGRPCConn(target string, stream byte, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func NewGRPCConnTLS(target string, stream byte, config *tls.Config, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func NewRaftTransport(mux *Mux, stream byte, maxPool int, timeout time.Duration, logger hclog.Logger) *raft.NetworkTransport
- func NewRaftTransportTLS(mux *Mux, stream byte, maxPool int, timeout time.Duration, config *tls.Config, ...) *raft.NetworkTransport
- type Mux
Constants ¶
View Source
const ( DefaultReadTimeout = 5 * time.Second DefaultAcceptTimeout = 5 * time.Second )
Variables ¶
View Source
var ( ErrConnectionClosed = errors.New("network connection closed") ErrConnectionTimeout = errors.New("network connection timed out") ErrHandlerClosed = errors.New("handler is already closed") ErrUnknownStream = errors.New("unknown stream") )
View Source
var ErrStreamByteWrite = errors.New("dial: stream byte not written")
Functions ¶
func DialContext ¶
func DialContext(ctx context.Context, network string, address string, stream byte) (net.Conn, error)
DialContext acts like Dial but takes a context.
func DialContextTLS ¶
func DialContextTLS( ctx context.Context, network string, address string, stream byte, config *tls.Config, ) (net.Conn, error)
DialContextTLS acts like DialTLS but takes a context.
func DialTLS ¶
DialTLS connects to the stream of Mux listening on address on the named network over TLS.
func NewGRPCConn ¶
func NewGRPCConn(target string, stream byte, opts ...grpc.DialOption) (*grpc.ClientConn, error)
NewGRPCConn creates new grpc.ClientConn that uses Dial for initiating connections.
func NewGRPCConnTLS ¶
func NewGRPCConnTLS(target string, stream byte, config *tls.Config, opts ...grpc.DialOption) (*grpc.ClientConn, error)
NewGRPCConnTLS creates new grpc.ClientConn that uses DialTLS for initiating connections.
func NewRaftTransport ¶
func NewRaftTransport( mux *Mux, stream byte, maxPool int, timeout time.Duration, logger hclog.Logger, ) *raft.NetworkTransport
NewRaftTransport creates new raft.NetworkTransport that uses Mux`s stream.
Types ¶
type Mux ¶
type Mux struct { ReadTimeout time.Duration AcceptTimeout time.Duration // contains filtered or unexported fields }
Mux is a multiplexer for a net.Listener.
Click to show internal directories.
Click to hide internal directories.