Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 327 Bytes
package gosteno
import (
"encoding/json"
)
type JsonCodec struct {
}
func NewJsonCodec() Codec {
return new(JsonCodec)
}
func (j *JsonCodec) EncodeRecord(record *Record) ([]byte, error) {
b, err := json.Marshal(record)
if err != nil {
return json.Marshal(map[string]string{"error": err.Error()})
}
return b, err
}