transports

package
v0.0.0-...-43847e8 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedReader

type ExtendedReader interface {
	io.Reader
	io.ByteReader
	// Peek returns the next n bytes without advancing the reader.
	Peek(int) ([]byte, error)
	// Buffered returns the number of bytes that can be read from the current buffer.
	Buffered() int
}

type Transport

type Transport interface {
	io.Closer
	// GetTransportCode Get the short code used to identify this transport (As used in the connection string)
	GetTransportCode() string
	// GetTransportName Get a human-readable name for this transport
	GetTransportName() string
	// CreateTransportInstance creates transport instance
	CreateTransportInstance(transportUrl url.URL, options map[string][]string, _options ...options.WithOption) (TransportInstance, error)
}

type TransportInstance

type TransportInstance interface {
	fmt.Stringer
	io.Closer
	Connect() error
	ConnectWithContext(ctx context.Context) error

	IsConnected() bool

	// FillBuffer fills the buffer `until` false (Useful in conjunction if you want GetNumBytesAvailableInBuffer)
	FillBuffer(until func(pos uint, currentByte byte, reader ExtendedReader) bool) error
	// GetNumBytesAvailableInBuffer returns the bytes currently available in buffer (!!!Careful: if you looking for a termination you have to use FillBuffer)
	GetNumBytesAvailableInBuffer() (uint32, error)
	PeekReadableBytes(numBytes uint32) ([]byte, error)
	Read(numBytes uint32) ([]byte, error)

	Write(data []byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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