mirror of
https://github.com/go-micro/go-micro.git
synced 2025-09-16 08:36:30 +02:00
update transport package comments
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user