Documentation ¶
Overview ¶
Package natslog provides an implementation of the Transport interface for the HashiCorp Raft library using NATS.
Index ¶
- Variables
- func NewNATSTransport(id string, conn *nats.Conn, timeout time.Duration, logOutput io.Writer) (*raft.NetworkTransport, error)
- func NewNATSTransportWithConfig(id string, conn *nats.Conn, config *raft.NetworkTransportConfig) (*raft.NetworkTransport, error)
- func NewNATSTransportWithLogger(id string, conn *nats.Conn, timeout time.Duration, logger *log.Logger) (*raft.NetworkTransport, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTimeout = errors.New("natslog: read timeout")
Functions ¶
func NewNATSTransport ¶
func NewNATSTransport(id string, conn *nats.Conn, timeout time.Duration, logOutput io.Writer) (*raft.NetworkTransport, error)
NewNATSTransport creates a new raft.NetworkTransport implemented with NATS as the transport layer.
func NewNATSTransportWithConfig ¶
func NewNATSTransportWithConfig(id string, conn *nats.Conn, config *raft.NetworkTransportConfig) (*raft.NetworkTransport, error)
NewNATSTransportWithConfig returns a raft.NetworkTransport implemented with NATS as the transport layer, using the given config struct.
func NewNATSTransportWithLogger ¶
func NewNATSTransportWithLogger(id string, conn *nats.Conn, timeout time.Duration, logger *log.Logger) (*raft.NetworkTransport, error)
NewNATSTransportWithLogger creates a new raft.NetworkTransport implemented with NATS as the transport layer using the provided Logger.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.