json

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 1 Imported by: 0

README

Swap out the json implementation by overwriting the types and variables.

Here the standard json implementation is swapped out with jsoniter:

package main

import (
    "github.com/discordpkg/gateway/json"
    jsoniter "github.com/json-iterator/go"
)

func init() {
    var j = jsoniter.ConfigCompatibleWithStandardLibrary
    
    json.Marshal = j.Marshal
    json.Unmarshal = j.Unmarshal	
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Marshal       = json.Marshal
	Unmarshal     = json.Unmarshal
	MarshalIndent = json.MarshalIndent
	Indent        = json.Indent
	NewDecoder    = json.NewDecoder
	NewEncoder    = json.NewEncoder
	Valid         = json.Valid
)

Functions

This section is empty.

Types

type Marshaler

type Marshaler interface {
	MarshalJSON() ([]byte, error)
}

type RawMessage

type RawMessage = json.RawMessage

type Unmarshaler

type Unmarshaler interface {
	UnmarshalJSON([]byte) error
}

Jump to

Keyboard shortcuts

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