Documentation ¶
Index ¶
- Variables
- func WithInsecure() grpc.DialOption
- type ClientConn
- type ClientPool
- type DialFun
- type DialOption
- type Header
- func (this *Header) Context(ctx context.Context) context.Context
- func (this *Header) Del(key string)
- func (this *Header) ForeachKey(handler func(key, val string) error) error
- func (this *Header) Get(key string) string
- func (this *Header) Len() int
- func (this *Header) Raw() metadata.MD
- func (this *Header) Set(key, value string)
- type Registry
- type Server
- func (this *Server) Addr() string
- func (this *Server) Domain() string
- func (this *Server) GracefulStop()
- func (this *Server) Name() string
- func (this *Server) Node() string
- func (this *Server) RegisterService(desc *grpc.ServiceDesc, impl interface{})
- func (this *Server) Registry() Registry
- func (this *Server) Run() error
- func (this *Server) Server() *grpc.Server
- func (this *Server) Service() string
- func (this *Server) Stop()
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrServerNotFound = errors.New("server not found")
)
Functions ¶
func WithInsecure ¶ added in v0.0.20
func WithInsecure() grpc.DialOption
Types ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
func Dial ¶
func Dial(target string, opts ...grpc.DialOption) *ClientConn
func (*ClientConn) Close ¶
func (this *ClientConn) Close()
func (*ClientConn) Invoke ¶
func (this *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...grpc.CallOption) error
func (*ClientConn) NewStream ¶
func (this *ClientConn) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
func (*ClientConn) Prepare ¶
func (this *ClientConn) Prepare()
type ClientPool ¶
type ClientPool struct {
// contains filtered or unexported fields
}
func NewClientPool ¶
func NewClientPool(size int32, fn DialFun) *ClientPool
func (*ClientPool) Close ¶
func (this *ClientPool) Close()
func (*ClientPool) Get ¶
func (this *ClientPool) Get() (*grpc.ClientConn, error)
func (*ClientPool) Prepare ¶
func (this *ClientPool) Prepare()
type DialFun ¶
type DialFun func() (*grpc.ClientConn, error)
type DialOption ¶
type DialOption struct { grpc.EmptyDialOption // contains filtered or unexported fields }
func WithPoolSize ¶
func WithPoolSize(size int32) DialOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) DialOption
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
func HeaderFromIncoming ¶
func HeaderFromMetadata ¶
func HeaderFromOutgoing ¶
func (*Header) ForeachKey ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GracefulStop ¶
func (this *Server) GracefulStop()
func (*Server) RegisterService ¶
func (this *Server) RegisterService(desc *grpc.ServiceDesc, impl interface{})
type ServerOption ¶
type ServerOption struct { grpc.EmptyServerOption // contains filtered or unexported fields }
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithRegisterTTL ¶
func WithRegisterTTL(ttl int64) ServerOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.