Documentation ¶
Index ¶
- Variables
- func Dial(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
- func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
- type ClientOption
- func WithDiscovery(d registry.Discovery) ClientOption
- func WithEndpoint(endpoint string) ClientOption
- func WithGzip() ClientOption
- func WithKeepalive() ClientOption
- func WithLog() ClientOption
- func WithMetric() ClientOption
- func WithOptions(opts ...grpc.DialOption) ClientOption
- func WithTimeout(timeout time.Duration) ClientOption
- func WithTracing() ClientOption
- func WithUnaryInterceptor(inter ...grpc.UnaryClientInterceptor) ClientOption
- func WithoutRetry() ClientOption
- type Server
- type ServerOption
- func Address(addr string) ServerOption
- func EnableLog() ServerOption
- func EnableTracing() ServerOption
- func Network(network string) ServerOption
- func Options(opts ...grpc.ServerOption) ServerOption
- func Timeout(timeout time.Duration) ServerOption
- func UnaryInterceptor(in ...grpc.UnaryServerInterceptor) ServerOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MetadataClientAPIVersionKey = "client-api-version"
)
Functions ¶
func DialInsecure ¶
func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
Types ¶
type ClientOption ¶
type ClientOption func(o *clientOptions)
ClientOption is a gRPC client option.
func WithDiscovery ¶
func WithDiscovery(d registry.Discovery) ClientOption
func WithOptions ¶
func WithOptions(opts ...grpc.DialOption) ClientOption
WithOptions with gRPC dial option.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout with a client timeout.
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(inter ...grpc.UnaryClientInterceptor) ClientOption
WithUnaryInterceptor with unary client interceptor.
type Server ¶
type Server struct { *grpc.Server // TracerOptions are options for OpenTelemetry gRPC interceptor. TracerOptions []otelgrpc.Option // contains filtered or unexported fields }
Server is a gRPC server wrapper. nolint
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
NewServer creates a gRPC server by options.
func (*Server) Endpoint ¶
Endpoint return a real address to registry endpoint. examples:
grpc://127.0.0.1:9090
type ServerOption ¶
type ServerOption func(o *Server)
ServerOption is gRPC server option.
func UnaryInterceptor ¶
func UnaryInterceptor(in ...grpc.UnaryServerInterceptor) ServerOption
UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the server.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.