# Functions
DefaultErrorEncoder writes the error to the subscriber reply.
EncodeJSONRequest is an EncodeRequestFunc that serializes the request as a JSON object to the Data of the Msg.
EncodeJSONResponse is a EncodeResponseFunc that serializes the response as a JSON object to the subscriber reply.
NewPublisher constructs a usable Publisher for a single remote method.
NewSubscriber constructs a new subscriber, which provides nats.MsgHandler and wraps the provided endpoint.
NopRequestDecoder is a DecodeRequestFunc that can be used for requests that do not need to be decoded, and simply returns nil, nil.
PublisherAfter sets the ClientResponseFuncs applied to the incoming NATS request prior to it being decoded.
PublisherBefore sets the RequestFuncs that are applied to the outgoing NATS request before it's invoked.
PublisherTimeout sets the available timeout for NATS request.
SubscriberAfter functions are executed on the subscriber reply after the endpoint is invoked, but before anything is published to the reply.
SubscriberBefore functions are executed on the publisher request object before the request is decoded.
SubscriberErrorEncoder is used to encode errors to the subscriber reply whenever they're encountered in the processing of a request.
SubscriberErrorHandler is used to handle non-terminal errors.
SubscriberErrorLogger is used to log non-terminal errors.
SubscriberFinalizer is executed at the end of every request from a publisher through NATS.
# Structs
Publisher wraps a URL and provides a method that implements endpoint.Endpoint.
Subscriber wraps an endpoint and provides nats.MsgHandler.
# Type aliases
DecodeRequestFunc extracts a user-domain request object from a publisher request object.
DecodeResponseFunc extracts a user-domain response object from an NATS response object.
EncodeRequestFunc encodes the passed request object into the NATS request object.
EncodeResponseFunc encodes the passed response object to the subscriber reply.
ErrorEncoder is responsible for encoding an error to the subscriber reply.
PublisherOption sets an optional parameter for clients.
PublisherResponseFunc may take information from an NATS request and make the response available for consumption.
RequestFunc may take information from a publisher request and put it into a request context.
SubscriberFinalizerFunc can be used to perform work at the end of an request from a publisher, after the response has been written to the publisher.
SubscriberOption sets an optional parameter for subscribers.
SubscriberResponseFunc may take information from a request context and use it to manipulate a Publisher.