json

package
v0.0.0-...-7c9799c Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package json provides JSON parsing utilities for Sidekiq job data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressBacktrace

func DecompressBacktrace(data string) ([]string, error)

DecompressBacktrace decompresses a base64+zlib compressed backtrace string. Sidekiq compresses backtraces to save Redis memory.

func GetBool

func GetBool(m map[string]interface{}, key string) bool

GetBool returns a bool value from a map, or false if not found/wrong type.

func GetFloat64

func GetFloat64(m map[string]interface{}, key string) float64

GetFloat64 returns a float64 value from a map, or 0 if not found/wrong type.

func GetInt64

func GetInt64(m map[string]interface{}, key string) int64

GetInt64 returns an int64 value from a map, or 0 if not found/wrong type. Handles both int64 and float64 (JSON numbers).

func GetMap

func GetMap(m map[string]interface{}, key string) map[string]interface{}

GetMap returns a map from a map, or nil if not found/wrong type.

func GetSlice

func GetSlice(m map[string]interface{}, key string) []interface{}

GetSlice returns an interface slice from a map, or nil if not found/wrong type.

func GetString

func GetString(m map[string]interface{}, key string) string

GetString returns a string value from a map, or empty string if not found/wrong type.

func GetStringSlice

func GetStringSlice(m map[string]interface{}, key string) []string

GetStringSlice returns a string slice from a map, or nil if not found/wrong type.

func GetTime

func GetTime(m map[string]interface{}, key string) time.Time

GetTime returns a time.Time from a Unix timestamp float64, or zero time if not found.

func Marshal

func Marshal(v interface{}) (string, error)

Marshal serializes a value to JSON string.

func Parse

func Parse(data string) (map[string]interface{}, error)

Parse parses a JSON string into a map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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