transport

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTransports

func GetTransports() []string

func RegisterTransportDriver

func RegisterTransportDriver(name string, t TransportDriver)

Types

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func FindTransport

func FindTransport(ctx context.Context, name string) (*Transport, error)

func (*Transport) Close

func (t *Transport) Close(ctx context.Context)

func (*Transport) Send

func (t *Transport) Send(key, data []byte) error

type TransportDriver

type TransportDriver interface {
	Prepare() error              // Prepare driver (eg: flag registration)
	Init(context.Context) error  // Initialize driver (eg: start connections, open files...)
	Close(context.Context) error // Close driver (eg: close connections and files...)
	Send(key, data []byte) error // Send a formatted message
}

type TransportInterface

type TransportInterface interface {
	Send(key, data []byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL