ai-gateway/common/marshaller.go

16 lines
235 B
Go
Raw Permalink Normal View History

2023-11-28 10:32:26 +00:00
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)
}