Vasiliy Tolstov
06136312bb
* regen files with never protoc * rewrite import path Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
26 lines
410 B
Go
26 lines
410 B
Go
package xml
|
|
|
|
import (
|
|
"encoding/xml"
|
|
|
|
"github.com/unistack-org/micro/v3/config/encoder"
|
|
)
|
|
|
|
type xmlEncoder struct{}
|
|
|
|
func (x xmlEncoder) Encode(v interface{}) ([]byte, error) {
|
|
return xml.Marshal(v)
|
|
}
|
|
|
|
func (x xmlEncoder) Decode(d []byte, v interface{}) error {
|
|
return xml.Unmarshal(d, v)
|
|
}
|
|
|
|
func (x xmlEncoder) String() string {
|
|
return "xml"
|
|
}
|
|
|
|
func NewEncoder() encoder.Encoder {
|
|
return xmlEncoder{}
|
|
}
|