Documentation
¶
Index ¶
- func InitLogger()
- func WithStreamClientInterceptors(interceptors ...grpc.StreamClientInterceptor) grpc.DialOption
- func WithStreamServerInterceptors(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption
- func WithUnaryClientInterceptors(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption
- func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
- type ClientOption
- type ClientOptions
- type DirectClient
- type DiscovClient
- type Logger
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalln(args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) V(v int) bool
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- func (l *Logger) Warningln(args ...interface{})
- type RegisterFn
- type Server
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger()
func WithStreamClientInterceptors ¶
func WithStreamClientInterceptors(interceptors ...grpc.StreamClientInterceptor) grpc.DialOption
func WithStreamServerInterceptors ¶
func WithStreamServerInterceptors(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption
func WithUnaryClientInterceptors ¶
func WithUnaryClientInterceptors(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption
func WithUnaryServerInterceptors ¶
func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
Types ¶
type ClientOption ¶
type ClientOption func(options *ClientOptions)
func WithDialOption ¶
func WithDialOption(opt grpc.DialOption) ClientOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
type ClientOptions ¶
type ClientOptions struct {
Timeout time.Duration
DialOptions []grpc.DialOption
}
type DirectClient ¶
type DirectClient struct {
// contains filtered or unexported fields
}
func NewDirectClient ¶
func NewDirectClient(server string, opts ...ClientOption) (*DirectClient, error)
func (*DirectClient) Conn ¶
func (c *DirectClient) Conn() *grpc.ClientConn
type DiscovClient ¶
type DiscovClient struct {
// contains filtered or unexported fields
}
func NewDiscovClient ¶
func NewDiscovClient(endpoints []string, key string, opts ...ClientOption) (*DiscovClient, error)
func (*DiscovClient) Conn ¶
func (c *DiscovClient) Conn() *grpc.ClientConn
type RegisterFn ¶
type Server ¶
type Server interface {
AddOptions(options ...grpc.ServerOption)
AddStreamInterceptors(interceptors ...grpc.StreamServerInterceptor)
AddUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor)
SetName(string)
Start(register RegisterFn) error
}
func NewRpcPubServer ¶
func NewRpcPubServer(etcdEndpoints []string, etcdKey, listenOn string, opts ...ServerOption) (Server, error)
func NewRpcServer ¶
func NewRpcServer(address string, opts ...ServerOption) Server
type ServerOption ¶
type ServerOption func(options *rpcServerOptions)
func WithMetrics ¶
func WithMetrics(metrics *stat.Metrics) ServerOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.