package
0.0.2
Repository: https://github.com/hhuuson97/socket.io-go.git
Documentation: pkg.go.dev

# 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()
}

# Functions

No description provided by the author