natsutil

package
v0.0.0-...-58998d9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeNATSJSONEvent

func DecodeNATSJSONEvent(decoderMap map[string]interface{}) natstransport.DecodeRequestFunc

Caution: Do not cargo cult this code. This is meant for specific use case based on our understanding of the message payload possibilities. DecodeNATSJSONEvent decodes the nats payload based on the msg subject -> request object map definition.

decoderMap := map[string]interface{}{
	OrderCreatedTopic:     	order.CreatedEvent{},
	OrderCancelledTopic:    order.CancelledEvent{},
}

func JSONErrorEncoder

func JSONErrorEncoder(l log.Logger) natstransport.ErrorEncoder

JSONErrorEncoder is a nats RPC JSON reply error encoder

func JSONResponseEncoder

func JSONResponseEncoder(encodeErr natstransport.ErrorEncoder) natstransport.EncodeResponseFunc

JSONResponseEncoder is a EncodeResponseFunc that serializes the response as a JSON object to the subscriber reply. Many JSON-over services can use it as a sensible default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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