jsonstr

package module
v0.0.0-...-a5a8363 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 3 Imported by: 1

README

go-jsonstr

Package jsonstr provides tools for working with strings in JSON.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-jsonstr

GoDoc

Import

To import package jsonstr use import code like the follownig:

import "github.com/reiver/go-jsonstr"

Installation

To install package jsonstr do the following:

GOPROXY=direct go get https://github.com/reiver/go-jsonstr

Author

Package jsonstr was written by Charles Iliya Krempeaux

Documentation

Index

Constants

View Source
const (
	ErrNotJSONArrayOfString = erorr.Error("jsonstr: not JSON array of strings")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Strings

type Strings struct {
	// contains filtered or unexported fields
}

Strings represents a JSON array of strings.

For example:

var strings jsonstr.Strings

// ...

jason := []byte(`["once", "twice", "thrice", "fource"]`)

err := json.Unmarshal(jason, &strings)

func CompileStrings

func CompileStrings(a ...string) Strings

func (Strings) Decompile

func (receiver Strings) Decompile() []string

func (Strings) MarshalJSON

func (receiver Strings) MarshalJSON() ([]byte, error)

func (*Strings) UnmarshalJSON

func (receiver *Strings) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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