In some cases we'll want to save the data from the stream directly with no transformation needed. This will allow us to return the raw data string from the stream * Add new StringToStringTransformer * Remove Record from codebase in favor of more generic interface
11 lines
254 B
Go
11 lines
254 B
Go
package connector
|
|
|
|
type StringToStringTransformer struct{}
|
|
|
|
func (t StringToStringTransformer) ToRecord(data []byte) interface{} {
|
|
return string(data)
|
|
}
|
|
|
|
func (t StringToStringTransformer) FromRecord(s interface{}) []byte {
|
|
return []byte(s.(string))
|
|
}
|