jsonmessageprocessor

package
v0.0.0-...-16240a8 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 12 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLinksToMessage

func AddLinksToMessage(messageType, serverURL string, msg map[string]interface{})

func Iface

func Iface(iface interface{}) interface{}

Iface recursively deep copies an interface{}

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)

Jump to

Keyboard shortcuts

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