json

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package json provides JSON serialization utilities for numeric types and a gorilla/rpc Codec that normalizes lowercase method names.

Index

Constants

View Source
const Null = "null"

Null is the string representation of the JSON null literal.

Variables

This section is empty.

Functions

func NewCodec

func NewCodec() rpc.Codec

NewCodec returns a new json codec that requires the first character of the method name to be lowercase and upper-cases it for dispatch.

Types

type Float32

type Float32 float32

Float32 is a float32 that marshals/unmarshals as a JSON string with 4 digit fixed-point precision.

func (Float32) MarshalJSON

func (f Float32) MarshalJSON() ([]byte, error)

func (*Float32) UnmarshalJSON

func (f *Float32) UnmarshalJSON(b []byte) error

type Float64

type Float64 float64

Float64 is a float64 that marshals/unmarshals as a JSON string.

func (Float64) MarshalJSON

func (f Float64) MarshalJSON() ([]byte, error)

func (*Float64) UnmarshalJSON

func (f *Float64) UnmarshalJSON(b []byte) error

type Uint8

type Uint8 uint8

Uint8 is a uint8 that marshals/unmarshals as a JSON string.

func (Uint8) MarshalJSON

func (u Uint8) MarshalJSON() ([]byte, error)

func (*Uint8) UnmarshalJSON

func (u *Uint8) UnmarshalJSON(b []byte) error

type Uint16

type Uint16 uint16

Uint16 is a uint16 that marshals/unmarshals as a JSON string.

func (Uint16) MarshalJSON

func (u Uint16) MarshalJSON() ([]byte, error)

func (*Uint16) UnmarshalJSON

func (u *Uint16) UnmarshalJSON(b []byte) error

type Uint32

type Uint32 uint32

Uint32 is a uint32 that marshals/unmarshals as a JSON string.

func (Uint32) MarshalJSON

func (u Uint32) MarshalJSON() ([]byte, error)

func (*Uint32) UnmarshalJSON

func (u *Uint32) UnmarshalJSON(b []byte) error

type Uint64

type Uint64 uint64

Uint64 is a uint64 that marshals/unmarshals as a JSON string.

func (Uint64) MarshalJSON

func (u Uint64) MarshalJSON() ([]byte, error)

func (*Uint64) UnmarshalJSON

func (u *Uint64) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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