gojson

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 3 Imported by: 0

README

go-json

This package is for go-json support. go-json is configured via EncodeOptionFunc and DecodeOptionFunc types.

Note that go-json's version is 0.10.0 at the time of writing. Please consider your backend's stability before using it.

Usage

import (
    sio "github.com/hhuuson97/socket.io-go"
    jsonparser "github.com/hhuuson97/socket.io-go/parser/json"
    gojson "github.com/hhuuson97/socket.io-go/parser/json/serializer/go-json"
    "github.com/goccy/go-json"
)

func main() {
    io := sio.NewServer(&sio.ServerConfig{
        ParserCreator: jsonparser.NewCreator(0, gojson.New(
            []json.EncodeOptionFunc{
                json.UnorderedMap(),
            },
            []json.DecodeOptionFunc{
                json.DecodeFieldPriorityFirstWin(),
            },
        )),
    })

    io.Run()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(encodeOptions []json.EncodeOptionFunc, decodeOptions []json.DecodeOptionFunc) serializer.JSONSerializer

Types

This section is empty.

Jump to

Keyboard shortcuts

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