json

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal convert type to JSON

Types

type Collection

type Collection struct {
	Collection gtly.Collection
}

Collection JSON collection wrapper

func (Collection) IsNil

func (c Collection) IsNil() bool

IsNil return true if collection is empty

func (Collection) MarshalJSONArray

func (c Collection) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray converts collection into JSON array

type Object

type Object struct {
	*gtly.Object
}

Object JSON wrapper

func (Object) MarshalJSONObject

func (o Object) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject converts an object into JSON object

type Slice

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

Slice represents a primitive JSON slice

func NewSlice

func NewSlice(data interface{}) *Slice

NewSlice creates a slice

func (Slice) IsNil

func (s Slice) IsNil() bool

IsNil returns true if empty

func (Slice) MarshalJSONArray

func (s Slice) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray converts primitive collection into JSON array

Jump to

Keyboard shortcuts

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