Documentation
¶
Overview ¶
Package transport provides a registry and interfaces for output transports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTransport is the base error for transport failures. ErrTransport = fmt.Errorf("transport error") )
Functions ¶
func GetTransports ¶
func GetTransports() []string
GetTransports returns the list of registered transport names.
func RegisterTransportDriver ¶
func RegisterTransportDriver(name string, t TransportDriver)
RegisterTransportDriver registers and prepares a transport under a name.
Types ¶
type DriverTransportError ¶
DriverTransportError wraps a driver-specific error with its transport name.
func (*DriverTransportError) Error ¶
func (e *DriverTransportError) Error() string
func (*DriverTransportError) Unwrap ¶
func (e *DriverTransportError) Unwrap() []error
type Transport ¶
type Transport struct {
TransportDriver
// contains filtered or unexported fields
}
Transport is a named transport wrapper used by the registry.
func FindTransport ¶
FindTransport returns a configured transport by name.
type TransportDriver ¶
type TransportDriver interface {
Prepare() error // Prepare driver (eg: flag registration)
Init() error // Initialize driver (eg: start connections, open files...)
Close() error // Close driver (eg: close connections and files...)
Send(key, data []byte) error // Send a formatted message
}
TransportDriver describes a transport plugin lifecycle and send method.
type TransportInterface ¶
TransportInterface is the minimal interface needed to send payloads.
Click to show internal directories.
Click to hide internal directories.