payload

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

type Payload struct {
	Pairs map[string]string
}

func Init

func Init() *Payload

Init returns a new payload object.

func (Payload) Add

func (p Payload) Add(key string, value *string)

Add pushes a key value pair to the payload.

func (Payload) AddDict

func (p Payload) AddDict(dict map[string]string)

AddDict pushes an array of key-value pairs to the payload.

func (Payload) AddJson

func (p Payload) AddJson(instance map[string]interface{}, isBase64 bool, keyEncoded string, keyNotEncoded string)

AddJson pushes a JSON formatted array to the payload. Json encodes the array first (turns it into a string) and then will encode (or not) the string in base64.

func (Payload) Get

func (p Payload) Get() map[string]string

Get returns the payload as a map[string]string.

func (Payload) String

func (p Payload) String() string

String returns a JSON representation of the internal Map.

Jump to

Keyboard shortcuts

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