json

package
v0.0.0-...-0be5f3d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultName   = "marshaler"
	DefaultPrefix = ""
	DefaultIndent = "  "
)

Variables

This section is empty.

Functions

func Marshal

func Marshal(g graph.Graph) ([]byte, error)

Marshal marshals g into JSON.

func StringPtr

func StringPtr(s string) *string

func Unmarshal

func Unmarshal(data []byte, g graph.Graph) error

Unmarshal unmarshals JSON data into g.

Types

type Marshaler

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

Marshaler implements graph.Marshaler.

func NewMarshaler

func NewMarshaler(name, prefix, indent string) (*Marshaler, error)

NewMarshaler creates a new Marshaler and returns it.

func (*Marshaler) Marshal

func (m *Marshaler) Marshal(g graph.Graph) ([]byte, error)

Marshal marshals g into JSON api model.

type Unmarshaler

type Unmarshaler struct{}

Unmarshaler implements graph.Unmarshaler.

func NewUnmarshaler

func NewUnmarshaler() (*Unmarshaler, error)

NewUnmarshaler creates a new Unmarshaler and returns it.

func (*Unmarshaler) Unmarshal

func (u *Unmarshaler) Unmarshal(data []byte, g graph.Graph) error

Unmarshal unmarshals data into graph.

Jump to

Keyboard shortcuts

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