Documentation
¶
Index ¶
- Variables
- func ChainIntercepter(ints ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func Dial(protocol, target string, options ...DialOption) (grpc.ClientConnInterface, error)
- func RegisterProtocol(name string, p Protocol)
- type BServerOption
- type CallOption
- type DialOption
- type Protocol
- type Server
- type ServerOption
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrProtocolNotFound = errors.New("protocol not found")
)
Functions ¶
func ChainIntercepter ¶
func ChainIntercepter(ints ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
func Dial ¶
func Dial(protocol, target string, options ...DialOption) (grpc.ClientConnInterface, error)
Dial creates a client connection to the given target according to the protocol.
func RegisterProtocol ¶
RegisterProtocol registers a protocol.
Types ¶
type BServerOption ¶
type BServerOption func(*ServerOptions)
type Protocol ¶
type Protocol interface { Dial(target string, options ...DialOption) (grpc.ClientConnInterface, error) NewServer(options ...ServerOption) Server }
Protocol defines how to make rpc call and serve rpc call.
type Server ¶
type Server interface { RegisterService(sd *grpc.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 ServerOption ¶
type ServerOption interface{}
ServerOption configures how we set up the server.
func WithInterceptor ¶
func WithInterceptor(interceptor grpc.UnaryServerInterceptor) ServerOption
type ServerOptions ¶
type ServerOptions struct {
Interceptor grpc.UnaryServerInterceptor
}
Click to show internal directories.
Click to hide internal directories.