package
0.0.2
Repository: https://github.com/rtsoftsg/go-kit.git
Documentation: pkg.go.dev

# Functions

DefaultErrorEncoder writes the error to the subscriber reply.
EncodeJSONResponse is a EncodeResponseFunc that serializes the response as a JSON object to the subscriber reply.
NewSubscriber constructs a new subscriber, which provides stan.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.
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 Streaming.

# Structs

Subscriber wraps an endpoint and provides stan.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 Streaming response object.
EncodeRequestFunc encodes the passed request object into the NATS Streaming request object.
EncodeResponseFunc encodes the passed response object to the subscriber reply.
ErrorEncoder is responsible for encoding an error to the subscriber reply.
PublisherResponseFunc may take information from an NATS Streaming request and make the response available for consumption.
RequestFunc may take information from a publisher request and put it into a request context.
ServerFinalizerFunc 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.