update transport package comments

This commit is contained in:
Asim Aslam 2019-07-07 15:03:08 +01:00
parent be33d9204a
commit 0b732b2c49

View File

@ -1,10 +1,21 @@
// Package transport is an interface for synchronous communication
// Package transport is an interface for connection based communication
package transport
import (
"time"
)
// Transport is an interface which is used for communication between
// services. It uses connection based socket send/recv semantics and
// has various implementations; http, grpc, quic.
type Transport interface {
Init(...Option) error
Options() Options
Dial(addr string, opts ...DialOption) (Client, error)
Listen(addr string, opts ...ListenOption) (Listener, error)
String() string
}
type Message struct {
Header map[string]string
Body []byte
@ -28,17 +39,6 @@ type Listener interface {
Accept(func(Socket)) error
}
// Transport is an interface which is used for communication between
// services. It uses socket send/recv semantics and had various
// implementations {HTTP, RabbitMQ, NATS, ...}
type Transport interface {
Init(...Option) error
Options() Options
Dial(addr string, opts ...DialOption) (Client, error)
Listen(addr string, opts ...ListenOption) (Listener, error)
String() string
}
type Option func(*Options)
type DialOption func(*DialOptions)