transport

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0, MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Requester

type Requester interface {
	// Close closes the connection
	Close() error

	// Request sends a blocking request and returns the response data or an error
	Request([]byte) ([]byte, error)
	// Subscribe provides a notification channel.
	// If subscription to notifications fails, it returns an error.
	Subscribe() (<-chan []byte, error)
}

Requester is a transport that can send requests and subscribe to notifications

type Responder

type Responder interface {
	// Close closes the connection
	Close() error
	// Url returns the url that the responder is listening on
	Url() string

	// RegisterRequestHandler registers a handler that accepts a request and returns a response.
	// It returns an error if the registration setup fails
	RegisterRequestHandler(string, func([]byte) []byte) error
	// Notify sends notification data without expecting a response
	Notify([]byte) error
}

Responder is a transport that can respond to requests and send notifications

type TransportType

type TransportType string
const (
	Nats TransportType = "nats"
	Http TransportType = "http"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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