Rename msgpackpp->msgpack, merge device+protocol->wire, absorb picoserial into client
This commit is contained in:
@@ -7,19 +7,22 @@ import (
|
||||
|
||||
"github.com/theater/picomap/lib/halfsiphash"
|
||||
"github.com/theater/picomap/lib/msgpack"
|
||||
"github.com/theater/picomap/lib/transport"
|
||||
"io"
|
||||
)
|
||||
|
||||
var HashKey = [8]byte{}
|
||||
|
||||
type Client struct {
|
||||
transport transport.Transport
|
||||
timeout time.Duration
|
||||
nextID atomic.Uint32
|
||||
type transport interface {
|
||||
Send(data []byte) error
|
||||
SetReadTimeout(timeout time.Duration)
|
||||
Reader() io.Reader
|
||||
Close() error
|
||||
}
|
||||
|
||||
func New(t transport.Transport, timeout time.Duration) *Client {
|
||||
return &Client{transport: t, timeout: timeout}
|
||||
type Client struct {
|
||||
transport transport
|
||||
timeout time.Duration
|
||||
nextID atomic.Uint32
|
||||
}
|
||||
|
||||
func (c *Client) Close() error {
|
||||
|
||||
Reference in New Issue
Block a user