// Encode marshals incoming event to it's json representation
Encode marshals incoming event to it's json representation
// Encode marshals incoming event to it ' s json representation
func (e *JsonEncoder) Encode(evt interface{}) (*EncodedEvt, error) {
	data, err := json.Marshal(evt)
	if err != nil {
		return nil, err
	}
	return &EncodedEvt{
		Type: reflect.TypeOf(evt).Name(),
		Data: string(data),
	}, nil
}
func ( e * JsonEncoder ) Encode ( evt interface { } ) ( * EncodedEvt , error ) { data , err := json . Marshal ( evt ) if err != nil { return nil , err } return & EncodedEvt { Type : reflect . TypeOf ( evt ) . Name ( ) , Data : string ( data ) , } , nil }
Encode marshals incoming event to it's json representation
Encode marshals incoming event to it ' s json representation