Documentation ¶
Overview ¶
Package deepcopy deep copies maps, slices, structs, etc. A standard copy will copy the pointers: deep copy copies the values pointed to.
Only what is needed has been implemented. Could make more dynamic, at the cost of reflection. Either adjust as needed or create a new function.
Copyright (c)2014, Joel Scoble (github.com/mohae), all rights reserved. License: MIT, for more details check the included LICENSE.txt.
Index ¶
- func AddLinksToMessage(messageType, serverURL string, msg map[string]interface{})
- func Iface(iface interface{}) interface{}
- func InterfaceToSliceOfInts(v interface{}) []int
- func InterfaceToSliceOfStrings(v interface{}) []string
- func PrettyPrintMap(msg map[string]interface{})
- type JsonMessageProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLinksToMessage ¶
func InterfaceToSliceOfInts ¶
func InterfaceToSliceOfInts(v interface{}) []int
InterfaceToSliceOfInts takes an interface that is a slice of ints and returns a deep copy of it as a slice of strings. An error is returned if the interface is not a slice of strings.
func InterfaceToSliceOfStrings ¶
func InterfaceToSliceOfStrings(v interface{}) []string
InterfaceToSliceOfStrings takes an interface that is either a slice of strings or a string and returns a deep copy of it as a slice of strings.
func PrettyPrintMap ¶
func PrettyPrintMap(msg map[string]interface{})
Types ¶
type JsonMessageProcessor ¶
type JsonMessageProcessor struct {
Config *Configuration
}
func NewJsonMessageProcessor ¶
func NewJsonMessageProcessor(cfg *Configuration) JsonMessageProcessor
func (JsonMessageProcessor) ProcessJSONMessage ¶
func (jsmp JsonMessageProcessor) ProcessJSONMessage(msg map[string]interface{}, routingKey string) ([]map[string]interface{}, error)
func (JsonMessageProcessor) ProcessJSONMessageWithFormat ¶
func (jsmp JsonMessageProcessor) ProcessJSONMessageWithFormat(msg map[string]interface{}, routingKey string) ([][]byte, error)