package json

import "github.com/spdx/tools-golang/json"

Index

Functions

func Read

func Read(content io.Reader) (*spdx.Document, error)

Read takes an io.Reader and returns a fully-parsed current model SPDX Document or an error if any error is encountered.

func ReadInto

func ReadInto(content io.Reader, doc common.AnyDocument) error

ReadInto takes an io.Reader, reads in the SPDX document at the version provided and converts to the doc version

func Write

func Write(doc common.AnyDocument, w io.Writer, opts ...WriteOption) error

Write takes an SPDX Document and an io.Writer, and writes the document to the writer in JSON format.

Types

type WriteOption

type WriteOption func(*json.Encoder)

func EscapeHTML

func EscapeHTML(escape bool) WriteOption

func Indent

func Indent(indent string) WriteOption

Source Files

reader.go writer.go

Directories

PathSynopsis
json/marshal
Version
v0.5.5 (latest)
Published
Jun 17, 2024
Platform
linux/amd64
Imports
10 packages
Last checked
3 weeks ago

Tools for package owners.