Install package using the following command:
go get -u github.com/andriimwks/tisp
This package uses io.Reader
interface to transfer data, so you can use net.Conn
, bytes.Buffer
etc.
package main
import (
"bytes"
"fmt"
"log"
"github.com/andriimwks/tisp"
)
func main() {
buf := new(bytes.Buffer)
err := tisp.Write(buf, "Hello", "World")
if err != nil {
log.Fatal(err)
}
values, err := tisp.Read(buf)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s, %s!\n", values[0], values[1]) // Hello, World!
}
- nil
- bool
- int/8/16/32/64
- uint/8/16/32/64
- float32/64
- string
- map[string]interface{}
- []interface{}