Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrProtocolNotFound = errors.New("protocol not found")
)
Functions ¶
func RegisterProtocol ¶
RegisterProtocol registers a protocol.
Types ¶
type ClientConn ¶
type ClientConn interface { // Invoke performs a unary RPC and returns after the response is received // into reply. Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...CallOption) error }
func Dial ¶
func Dial(protocol, target string, options ...DialOption) (ClientConn, error)
Dial creates a client connection to the given target according to the protocol.
type Protocol ¶
type Protocol interface { Dial(target string, options ...DialOption) (ClientConn, error) NewServer(options ...ServerOption) Server }
Protocol defines how to make rpc call and serve rpc call.
type Server ¶
type Server interface { RegisterService(sd *ServiceDesc, ss interface{}) Serve(l net.Listener) error }
Server is the interface that must be implemented by a protocol server.
func NewServer ¶
func NewServer(protocol string, options ...ServerOption) Server
NewServer creates a new server according to the protocol.
type ServiceDesc ¶
type ServiceDesc = grpc.ServiceDesc
Click to show internal directories.
Click to hide internal directories.