mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-29 14:46:38 +08:00
16 lines
235 B
Go
16 lines
235 B
Go
package common
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type Marshaller interface {
|
|
Marshal(value any) ([]byte, error)
|
|
}
|
|
|
|
type JSONMarshaller struct{}
|
|
|
|
func (jm *JSONMarshaller) Marshal(value any) ([]byte, error) {
|
|
return json.Marshal(value)
|
|
}
|