// NewJSONEncoder constructs json encoder
// It receives a slice of event types it should be able to encode/decode
NewJSONEncoder constructs json encoder
It receives a slice of event types it should be able to encode/decode
// NewJSONEncoder constructs json encoder // It receives a slice of event types it should be able to encode / decode
func NewJSONEncoder(evts ...interface{}) *JsonEncoder {
	enc := JsonEncoder{
		types: make(map[string]reflect.Type),
	}
	for _, evt := range evts {
		t := reflect.TypeOf(evt)
		enc.types[t.Name()] = t
	}
	return &enc
}
func NewJSONEncoder ( evts ... interface { } ) * JsonEncoder { enc := JsonEncoder { types : make ( map [ string ] reflect . Type ) , } for _ , evt := range evts { t := reflect . TypeOf ( evt ) enc . types [ t . Name ( ) ] = t } return & enc }
NewJSONEncoder constructs json encoder
It receives a slice of event types it should be able to encode/decode
NewJSONEncoder constructs json encoder It receives a slice of event types it should be able to encode / decode