Documentation
¶
Index ¶
- Constants
- func GenerateSign(secret string, message []byte) (auth string, err error)
- func New(target string, options ...Option) (*grpc.ClientConn, error)
- func ProtoMessage2JSON(message proto.Message) (string, error)
- func ProtoMessage2Map(message proto.Message) (map[string]interface{}, error)
- type ClientInterceptor
- type Option
- type Sign
- type Trace
Constants ¶
View Source
const (
// ProxyAuthorization used by signature, both gateway and grpc
ProxyAuthorization = "proxy-authorization"
)
View Source
const (
// Trace ID
TraceID = "trace-id"
)
Variables ¶
This section is empty.
Functions ¶
func ProtoMessage2JSON ¶
ProtoMessage2JSON marshal protobuf message to json string
Types ¶
type ClientInterceptor ¶
type ClientInterceptor struct {
// contains filtered or unexported fields
}
ClientInterceptor the client's interceptor
func NewClientInterceptor ¶
NewClientInterceptor create a client interceptor
func (*ClientInterceptor) UnaryInterceptor ¶
func (c *ClientInterceptor) UnaryInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error)
UnaryInterceptor a interceptor for client unary operations
type Option ¶
type Option func(*option)
func WithCredential ¶
func WithCredential(credential credentials.TransportCredentials) Option
WithCredential setup credential for tls
func WithDialTimeout ¶
WithDialTimeout setup the dial timeout
func WithKeepAlive ¶
func WithKeepAlive(keepalive *keepalive.ClientParameters) Option
WithKeepAlive setup keepalive parameters
Click to show internal directories.
Click to hide internal directories.