mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 03:47:38 +03:00
23 lines
641 B
Go
23 lines
641 B
Go
package json
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sagernet/sing/common/json/internal/contextjson"
|
|
)
|
|
|
|
var (
|
|
MarshalContext = json.MarshalContext
|
|
UnmarshalContext = json.UnmarshalContext
|
|
NewEncoderContext = json.NewEncoderContext
|
|
NewDecoderContext = json.NewDecoderContext
|
|
UnmarshalContextDisallowUnknownFields = json.UnmarshalContextDisallowUnknownFields
|
|
)
|
|
|
|
type ContextMarshaler interface {
|
|
MarshalJSONContext(ctx context.Context) ([]byte, error)
|
|
}
|
|
|
|
type ContextUnmarshaler interface {
|
|
UnmarshalJSONContext(ctx context.Context, content []byte) error
|
|
}
|