json

package
v0.0.0-...-a41e324 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 6 Imported by: 0

README

JSON Starlark module

Usage

predeclared := starlark.StringDict{
    "json": json.New()
    ...
}
starlark.ExecFile(thread, filename, nil, predeclared)

Supported functions

json.parse(string) dict

Parses JSON string to Starlark dict. Returns error and None value on parse error. Uses json.Unmarshal Go function.

json.dump(dict) string

Serialize Starlark dict to JSON. Returns error and None value on parse error. Uses json.Marshal Go function.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Marshal   = json.Marshal
	Unmarshal = json.Unmarshal
)

Functions

func New

func New() starlark.Value

Types

type Json

type Json struct{}

func (Json) Methods

func (Json) Methods() map[string]builtin.Function

Jump to

Keyboard shortcuts

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