Documentation ¶
Index ¶
Constants ¶
View Source
const (
PropertyHasError = "error"
)
Common message property names
Variables ¶
View Source
var ( ErrEndpointAlreadyBound = errors.New("Endpoint already bound") ErrNoEndpointsBound = errors.New("No endpoints bound") ErrTimeout = errors.New("Request timeout") )
View Source
var NullLogger = nullLogger{}
The NullLogger discards any log message
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Trace(msg string, args ...interface{}) Debug(msg string, args ...interface{}) Info(msg string, args ...interface{}) Warn(msg string, args ...interface{}) error Error(msg string, args ...interface{}) error Fatal(msg string, args ...interface{}) }
The Logger interface must be implemented by any logger that can be plugged into usrv.
This interface has been copied from logxi (https://github.com/mgutz/logxi)
type Message ¶
type Message interface { From() string To() string Property() Property CorrelationId() string Content() ([]byte, error) SetContent([]byte, error) }
The message interface is implemented by all messages that can be passed through a transport.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type Transport ¶
type Transport interface { // Attach a logger to the transport. SetLogger(logger Logger) // Configure the transport. Config(params map[string]string) error // Close the transport. Close() error // Bind service endpoint. Returns a channel that emits incoming Messages to that endpoint Bind(service string, endpoint string) (<-chan Message, error) // Send a message. Send(message Message, timeout time.Duration, expectReply bool) <-chan Message // Create a message to be delivered to a target endpoint MessageTo(from string, toService string, toEndpoint string) Message // Create a message that serves as a reply to an incoming message ReplyTo(message Message) Message }
Click to show internal directories.
Click to hide internal directories.