mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
- Replace direct zerolog usage with standard library `log/slog` in business code - Add `internal/logging` package with zerolog bridge handler for structured output - Create `internal/jsoncodec` package to centralize JSON encoding/decoding using Sonic - Update all services and main entry point to use new logging interface - Maintain backward compatibility with existing zerolog console output - Remove custom logger setup in favor of structured logging bridge
18 lines
478 B
Go
18 lines
478 B
Go
package jsoncodec
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/bytedance/sonic"
|
|
)
|
|
|
|
func Marshal(v any) ([]byte, error) { return sonic.Marshal(v) }
|
|
|
|
func Unmarshal(data []byte, v any) error { return sonic.Unmarshal(data, v) }
|
|
|
|
func UnmarshalString(data string, v any) error { return sonic.UnmarshalString(data, v) }
|
|
|
|
func NewEncoder(w io.Writer) sonic.Encoder { return sonic.ConfigDefault.NewEncoder(w) }
|
|
|
|
func NewDecoder(r io.Reader) sonic.Decoder { return sonic.ConfigDefault.NewDecoder(r) }
|