package
0.0.0-20190611062118-846cad29aa60
Repository: https://github.com/solution9th/nsbridge.git
Documentation: pkg.go.dev
# Functions
AuthMiddleware api auth middleware 每一个通过这个中间件的都会增加一个 标志性 header grpc 通过辨识合格 header 从而判断 请求是来自 http(gateway) 还是 grpc client.
CheckRecordPermission 校验Recordid 和 key 是否匹配.
GatewayHaderMatcher 自定义 gRPC 网关 header key 转换方式 如果是 http 固定 header,取值的 key(例如:Cookie) => gg-cookie 如果是自定义的 header 则必须有 Gg- 前缀(例如: Gg-Token),取值 key => token.
GetHeaderKey 获取头文件中的 key.
GetSecret 根据 key 的前缀区分 key 的类型.
IsHTTPRequest 判断流量是否来自 http.
IsOkRequest 判断请求是否通过鉴权的 gRPCKey 是在 grpc 请求中的 key.
IsRecordKey 判断 key 是否是操作 record 的 key.
New new a rpc server.
TypeConvert 类型转换,输入数据库类型,转换成 proto3 类型 需要 struct tag json 相同.
# Constants
No description provided by the author
APIKeyName 请求头中的 api key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GRPCFlag 只要是 http 请求就会有这个 header.
MetadataHeaderPrefix grpc 中的前缀.
MetadataPrefix 请求头前缀.