jsonutil

package
v0.0.0-...-82ab749 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustOneLineString

func MustOneLineString(document interface{}) string

func MustString

func MustString(document interface{}) string

func OneLineString

func OneLineString(document interface{}) (string, error)

func PrettyPrint

func PrettyPrint(w io.Writer, i interface{})

func Read

func Read(pathname string, document interface{}) error

func String

func String(document interface{}) (string, error)

func Write

func Write(document interface{}, pathname string) error

Types

type Admonition

type Admonition struct{}

func (Admonition) MarshalJSON

func (Admonition) MarshalJSON() ([]byte, error)

func (Admonition) UnmarshalJSON

func (Admonition) UnmarshalJSON([]byte) error

type StringSlice

type StringSlice []string

StringSlice is a JSON-aware []string that can cope with AWS' bad habit of turning single-element JSON arrays of strings into strings.

func (*StringSlice) Add

func (p *StringSlice) Add(s string)

Add adds the given string to p as if it were a set. That is, s is added to p if and only if it isn't already there. p will be sorted every time this method is called but it will usually be a no-op.

func (StringSlice) Len

func (ss StringSlice) Len() int

func (StringSlice) Less

func (ss StringSlice) Less(i, j int) bool

func (StringSlice) Swap

func (ss StringSlice) Swap(i, j int)

func (*StringSlice) UnmarshalJSON

func (p *StringSlice) UnmarshalJSON(b []byte) error

type SubstrateVersion

type SubstrateVersion string

func (SubstrateVersion) MarshalJSON

func (v SubstrateVersion) MarshalJSON() ([]byte, error)

func (SubstrateVersion) UnmarshalJSON

func (SubstrateVersion) UnmarshalJSON([]byte) error

Jump to

Keyboard shortcuts

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