jsonapi

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package jsonapi holds the wire-format transforms every handler shares: the metadata key casing (camelCase on the wire, snake_case stored) and the timestamp rendering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelizeDeep

func CamelizeDeep(v any) any

CamelizeDeep transforms every key of the value back to lowerCamelCase.

func CamelizeKey

func CamelizeKey(key string) string

CamelizeKey reproduces Rails' camelize(:lower): lowerCamelCase from a snake_case or dashed key.

func Timestamp

func Timestamp(t time.Time) string

Timestamp renders t exactly like the reference: RFC3339 with exactly three fractional digits and a Z suffix, e.g. 2026-10-22T11:23:22.953Z.

func UnderscoreDeep

func UnderscoreDeep(v any) any

UnderscoreDeep transforms every key of the value (maps, recursively; slices and their maps too).

func UnderscoreKey

func UnderscoreKey(key string) string

UnderscoreKey reproduces Rails' underscore + parameterize('_'): the whole request body (metadata keys included) arrives snake_cased.

Types

This section is empty.

Jump to

Keyboard shortcuts

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