Skip to content

Commit

Permalink
add drop-in json library adapter
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Zhu <hackzhuyan@gmail.com>
  • Loading branch information
halfcrazy committed Sep 11, 2023
1 parent 6785b52 commit e8ff116
Show file tree
Hide file tree
Showing 51 changed files with 219 additions and 85 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OVS_VERSION ?= v2.16.0
TAG ?= std

.PHONY: all
all: lint build test integration-test coverage
Expand All @@ -14,14 +15,14 @@ prebuild: modelgen ovsdb/serverdb/_server.ovsschema example/vswitchd/ovs.ovssche
@go generate -v ./...

.PHONY: build
build: prebuild
build: prebuild
@echo "+ $@"
@go build -v ./...

.PHONY: test
test: prebuild
@echo "+ $@"
@go test -race -coverprofile=unit.cov -test.short -timeout 30s -v ./...
@go test -race -coverprofile=unit.cov -tags $(TAG) -test.short -timeout 30s -v ./...

.PHONY: integration-test
integration-test:
Expand All @@ -36,7 +37,7 @@ coverage: test integration-test
.PHONY: bench
bench: install-deps prebuild
@echo "+ $@"
@go test -run=XXX -count=3 -bench=. ./... | tee bench.out
@go test -run=XXX -count=3 -tags $(TAG) -bench=. ./... | tee bench.out
@benchstat bench.out

.PHONY: install-deps
Expand Down
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,73 @@ In your application, load the ClientDBModel, connect to the server and start int
fmt.Printf("My Router has UUID: %s and %d Ports\n", lr.UUID, len(lr.Ports))
}

## Drop-in json library

There are two json libraries to use as a drop-in replacement for std json library.
[go-json](https://github.com/goccy/go-json) and [json-iterator](https://github.com/json-iterator/go)

go build your application with -tags go_json or jsoniter

$ benchstat bench.out.std bench.out.jsoniter bench.out.go_json
goos: linux
goarch: amd64
pkg: github.com/ovn-org/libovsdb/ovsdb
cpu: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
│ bench.out.std │ bench.out.jsoniter │ bench.out.go_json │
│ sec/op │ sec/op vs base │ sec/op vs base │
MapMarshalJSON1-4 2.234µ ± ∞ ¹ 1.621µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.289µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapMarshalJSON2-4 3.109µ ± ∞ ¹ 2.283µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.834µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapMarshalJSON3-4 4.165µ ± ∞ ¹ 2.900µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.404µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapMarshalJSON5-4 6.058µ ± ∞ ¹ 4.119µ ± ∞ ¹ ~ (p=0.100 n=3) ² 3.421µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapMarshalJSON8-4 8.978µ ± ∞ ¹ 5.685µ ± ∞ ¹ ~ (p=0.100 n=3) ² 4.912µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapUnmarshalJSON1-4 3.208µ ± ∞ ¹ 2.437µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.944µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapUnmarshalJSON2-4 4.525µ ± ∞ ¹ 3.579µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.659µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapUnmarshalJSON3-4 6.015µ ± ∞ ¹ 4.780µ ± ∞ ¹ ~ (p=0.100 n=3) ² 3.404µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapUnmarshalJSON5-4 9.121µ ± ∞ ¹ 7.061µ ± ∞ ¹ ~ (p=0.100 n=3) ² 4.914µ ± ∞ ¹ ~ (p=0.100 n=3) ²
MapUnmarshalJSON8-4 13.912µ ± ∞ ¹ 10.242µ ± ∞ ¹ ~ (p=0.100 n=3) ² 7.076µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONString1-4 668.7n ± ∞ ¹ 511.9n ± ∞ ¹ ~ (p=0.100 n=3) ² 393.8n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONString2-4 1756.0n ± ∞ ¹ 1243.0n ± ∞ ¹ ~ (p=0.100 n=3) ² 972.6n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONString3-4 1.977µ ± ∞ ¹ 1.320µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.082µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONString5-4 2.463µ ± ∞ ¹ 1.561µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.327µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONString8-4 3.310µ ± ∞ ¹ 1.929µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.647µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONInt1-4 605.4n ± ∞ ¹ 495.1n ± ∞ ¹ ~ (p=0.100 n=3) ² 405.5n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONInt2-4 1.612µ ± ∞ ¹ 1.253µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.057µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONInt3-4 1.766µ ± ∞ ¹ 1.327µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.200µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONInt5-4 2.082µ ± ∞ ¹ 1.560µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.423µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONInt8-4 2.554µ ± ∞ ¹ 1.906µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.772µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONFloat1-4 676.8n ± ∞ ¹ 562.1n ± ∞ ¹ ~ (p=0.100 n=3) ² 489.2n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONFloat2-4 1.599µ ± ∞ ¹ 1.205µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.025µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONFloat3-4 1.761µ ± ∞ ¹ 1.341µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.148µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONFloat5-4 2.090µ ± ∞ ¹ 1.576µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.379µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONFloat8-4 2.543µ ± ∞ ¹ 1.902µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.720µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONUUID1-4 1227.0n ± ∞ ¹ 570.0n ± ∞ ¹ ~ (p=0.100 n=3) ² 485.8n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONUUID2-4 2.875µ ± ∞ ¹ 1.311µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.142µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONUUID3-4 3.594µ ± ∞ ¹ 1.490µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.313µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONUUID5-4 5.184µ ± ∞ ¹ 1.832µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.674µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetMarshalJSONUUID8-4 7.555µ ± ∞ ¹ 2.333µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.252µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONString1-4 848.8n ± ∞ ¹ 769.3n ± ∞ ¹ ~ (p=0.100 n=3) ² 517.0n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONString2-4 2.722µ ± ∞ ¹ 2.270µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.684µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONString3-4 3.264µ ± ∞ ¹ 2.790µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.940µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONString5-4 4.482µ ± ∞ ¹ 3.580µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.414µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONString8-4 5.980µ ± ∞ ¹ 4.519µ ± ∞ ¹ ~ (p=0.100 n=3) ² 3.010µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONInt1-4 741.6n ± ∞ ¹ 942.9n ± ∞ ¹ ~ (p=0.100 n=3) ² 514.6n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONInt2-4 2.394µ ± ∞ ¹ 2.236µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.709µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONInt3-4 2.839µ ± ∞ ¹ 2.667µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.048µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONInt5-4 3.521µ ± ∞ ¹ 3.425µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.497µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONInt8-4 4.383µ ± ∞ ¹ 4.227µ ± ∞ ¹ ~ (p=0.100 n=3) ² 3.066µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONFloat1-4 845.2n ± ∞ ¹ 960.0n ± ∞ ¹ ~ (p=0.100 n=3) ² 541.3n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONFloat2-4 2.606µ ± ∞ ¹ 2.264µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.748µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONFloat3-4 3.141µ ± ∞ ¹ 2.667µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.040µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONFloat5-4 4.118µ ± ∞ ¹ 3.436µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.560µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONFloat8-4 5.149µ ± ∞ ¹ 4.286µ ± ∞ ¹ ~ (p=0.100 n=3) ² 3.141µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONUUID1-4 1802.0n ± ∞ ¹ 879.3n ± ∞ ¹ ~ (p=0.100 n=3) ² 613.5n ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONUUID2-4 5.697µ ± ∞ ¹ 2.503µ ± ∞ ¹ ~ (p=0.100 n=3) ² 1.899µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONUUID3-4 7.469µ ± ∞ ¹ 3.035µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.218µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONUUID5-4 11.604µ ± ∞ ¹ 3.965µ ± ∞ ¹ ~ (p=0.100 n=3) ² 2.987µ ± ∞ ¹ ~ (p=0.100 n=3) ²
SetUnmarshalJSONUUID8-4 17.097µ ± ∞ ¹ 5.168µ ± ∞ ¹ ~ (p=0.100 n=3) ² 3.731µ ± ∞ ¹ ~ (p=0.100 n=3) ²
geomean 2.982µ 2.057µ -31.03% 1.606µ -46.14%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

## Running the tests

Expand Down
2 changes: 1 addition & 1 deletion cache/cache_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package cache

import (
"encoding/json"
"fmt"
"math/rand"
"testing"

"github.com/go-logr/logr"
"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
"github.com/ovn-org/libovsdb/test"
Expand Down
2 changes: 1 addition & 1 deletion cache/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Package cache provides a cache of model.Model elements that can be used in an OV
The cache can be accessed using a simple API:
cache.Table("Open_vSwitch").Row("<ovs-uuid>")
cache.Table("Open_vSwitch").Row("<ovs-uuid>")
It implements the ovsdb.NotificationHandler interface
such that it can be populated automatically by
Expand Down
4 changes: 2 additions & 2 deletions client/api_test_model.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package client

import (
"encoding/json"
"testing"

"github.com/ovn-org/libovsdb/cache"
"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -128,7 +128,7 @@ func (*testLogicalSwitch) Table() string {
return "Logical_Switch"
}

//LogicalSwitchPort struct defines an object in Logical_Switch_Port table
// LogicalSwitchPort struct defines an object in Logical_Switch_Port table
type testLogicalSwitchPort struct {
UUID string `ovsdb:"_uuid"`
Up *bool `ovsdb:"up"`
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package client
import (
"context"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"log"
Expand All @@ -21,6 +20,7 @@ import (
"github.com/go-logr/logr"
"github.com/go-logr/stdr"
"github.com/ovn-org/libovsdb/cache"
"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/mapper"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
Expand Down
2 changes: 1 addition & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package client

import (
"context"
"encoding/json"
"fmt"
"math/rand"
"os"
Expand All @@ -17,6 +16,7 @@ import (
"github.com/google/uuid"
"github.com/ovn-org/libovsdb/cache"
db "github.com/ovn-org/libovsdb/database"
"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/mapper"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
Expand Down
38 changes: 18 additions & 20 deletions client/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@ Package client connects to, monitors and interacts with OVSDB servers (RFC7047).
This package uses structs, that contain the 'ovs' field tag to determine which field goes to
which column in the database. We refer to pointers to this structs as Models. Example:
type MyLogicalSwitch struct {
UUID string `ovsdb:"_uuid"` // _uuid tag is mandatory
Name string `ovsdb:"name"`
Ports []string `ovsdb:"ports"`
Config map[string]string `ovsdb:"other_config"`
}
type MyLogicalSwitch struct {
UUID string `ovsdb:"_uuid"` // _uuid tag is mandatory
Name string `ovsdb:"name"`
Ports []string `ovsdb:"ports"`
Config map[string]string `ovsdb:"other_config"`
}
Based on these Models a Database Model (see ClientDBModel type) is built to represent
the entire OVSDB:
clientDBModel, _ := client.NewClientDBModel("OVN_Northbound",
map[string]client.Model{
"Logical_Switch": &MyLogicalSwitch{},
})
clientDBModel, _ := client.NewClientDBModel("OVN_Northbound",
map[string]client.Model{
"Logical_Switch": &MyLogicalSwitch{},
})
The ClientDBModel represents the entire Database (or the part of it we're interested in).
Using it, the libovsdb.client package is able to properly encode and decode OVSDB messages
and store them in Model instances.
A client instance is created by simply specifying the connection information and the database model:
ovs, _ := client.Connect(context.Background(), clientDBModel)
ovs, _ := client.Connect(context.Background(), clientDBModel)
Main API
# Main API
After creating a OvsdbClient using the Connect() function, we can use a number of CRUD-like
to interact with the database:
Expand All @@ -43,7 +42,7 @@ and passed to client.Transact().
Others, such as List() and Get(), interact with the client's internal cache and are able to
return Model instances (or a list thereof) directly.
Conditions
# Conditions
Some API functions (Create() and Get()), can be run directly. Others, require us to use
a ConditionalAPI. The ConditionalAPI injects RFC7047 Conditions into ovsdb Operations as well as
Expand Down Expand Up @@ -111,15 +110,15 @@ cache element, an operation will be created matching on the "_uuid" column. The
quite large depending on the cache size and the provided function. Most likely there is a way to express the
same condition using Where() or WhereAll() which will be more efficient.
Get
# Get
Get() operation is a simple operation capable of retrieving one Model based on some of its schema indexes. E.g:
ls := &LogicalSwitch{UUID:"myUUID"}
err := ovs.Get(ls)
fmt.Printf("Name of the switch is: &s", ls.Name)
List
# List
List() searches the cache and populates a slice of Models. It can be used directly or using WhereCache()
Expand All @@ -131,7 +130,7 @@ List() searches the cache and populates a slice of Models. It can be used direct
return strings.HasPrefix(ls.Name, "ext_")
}).List(lsList)
Create
# Create
Create returns a list of operations to create the models provided. E.g:
Expand All @@ -143,7 +142,7 @@ Update returns a list of operations to update the matching rows to match the val
ls := &LogicalSwitch{ExternalIDs: map[string]string {"foo": "bar"}}
ops, err := ovs.Where(...).Update(&ls, &ls.ExternalIDs}
Mutate
# Mutate
Mutate returns a list of operations needed to mutate the matching rows as described by the list of Mutation objects. E.g:
Expand All @@ -154,11 +153,10 @@ Mutate returns a list of operations needed to mutate the matching rows as descri
Value: map[string]string{"foo":"bar"},
})
Delete
# Delete
Delete returns a list of operations needed to delete the matching rows. E.g:
ops, err := ovs.Where(...).Delete()
*/
package client
2 changes: 1 addition & 1 deletion client/monitor_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package client

import (
"encoding/json"
"testing"

"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion cmd/modelgen/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package main

import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"

"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/modelgen"
"github.com/ovn-org/libovsdb/ovsdb"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/print_schema/print_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
Expand All @@ -10,6 +9,7 @@ import (
"runtime"
"runtime/pprof"

"github.com/ovn-org/libovsdb/internal/json"
"github.com/ovn-org/libovsdb/ovsdb"
)

Expand Down
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ require (
github.com/cenkalti/rpc2 v0.0.0-20210604223624-c1acbc6ec984
github.com/go-logr/logr v1.2.2
github.com/go-logr/stdr v1.2.2
github.com/goccy/go-json v0.10.2
github.com/google/uuid v1.2.0
github.com/json-iterator/go v1.1.12
github.com/ory/dockertest/v3 v3.9.1
github.com/prometheus/client_golang v1.12.1
github.com/stretchr/testify v1.8.0
Expand Down Expand Up @@ -36,6 +38,8 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.2 // indirect
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -178,6 +180,7 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
Expand All @@ -203,9 +206,11 @@ github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdx
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk=
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
Expand Down
13 changes: 13 additions & 0 deletions internal/json/go_json.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build go_json

package json

import json "github.com/goccy/go-json"

var (
Marshal = json.Marshal
Unmarshal = json.Unmarshal
MarshalIndent = json.MarshalIndent
)

type RawMessage = json.RawMessage
Loading

0 comments on commit e8ff116

Please sign in to comment.