Documentation ¶
Index ¶
- Constants
- Variables
- func NewExceptionFromTrailer(md metadata.MD, err error) exception.APIException
- type GrpcInCtx
- func (c *GrpcInCtx) Context() context.Context
- func (c *GrpcInCtx) GetAccessToKen() string
- func (c *GrpcInCtx) GetClientID() string
- func (c *GrpcInCtx) GetClientSecret() string
- func (c *GrpcInCtx) GetNamespace() string
- func (c *GrpcInCtx) GetRequestID() string
- func (c GrpcInCtx) SetAccessToken(ak string)
- func (c *GrpcInCtx) SetClientCredentials(clientID, clientSecret string)
- func (c *GrpcInCtx) SetRequestID(requestID string)
- type GrpcOutCtx
Constants ¶
View Source
const ( // NamespaceHeader 空间 NamespaceHeader = "x-rpc-namespace" // InternalCallTokenHeader todo InternalCallTokenHeader = "internal-call-token" // ClientIDHeader tood ClientIDHeader = "client-id" // ClientSecretHeader todo ClientSecretHeader = "client-secret" // OauthTokenHeader todo OauthTokenHeader = "x-oauth-token" // RealIPHeader todo RealIPHeader = "x-real-ip" // UserAgentHeader todo UserAgentHeader = "user-agent" // RequestID todo RequestID = "x-request-id" )
View Source
const ( // ResponseCodeHeader todo ResponseCodeHeader = "x-rpc-code" // ResponseReasonHeader todo ResponseReasonHeader = "x-rpc-reason" // ResponseDescHeader todo ResponseDescHeader = "x-rpc-desc" // ResponseMetaHeader todo ResponseMetaHeader = "x-rpc-meta" // ResponseDataHeader todo ResponseDataHeader = "x-rpc-data" )
Variables ¶
View Source
var (
// Namespace todo
Namespace = "default"
)
Functions ¶
func NewExceptionFromTrailer ¶
func NewExceptionFromTrailer(md metadata.MD, err error) exception.APIException
NewExceptionFromTrailer todo
Types ¶
type GrpcInCtx ¶
type GrpcInCtx struct {
// contains filtered or unexported fields
}
GrpcInCtx todo
func (*GrpcInCtx) GetClientSecret ¶
GetClientSecret todo
func (*GrpcInCtx) GetNamespace ¶ added in v0.8.3
GetNamespace todo
func (*GrpcInCtx) GetRequestID ¶ added in v0.8.8
GetRequestID 获取ID
func (*GrpcInCtx) SetClientCredentials ¶
SetClientCredentials todo
func (*GrpcInCtx) SetRequestID ¶ added in v0.8.8
SetRequestID 设置ID
type GrpcOutCtx ¶
type GrpcOutCtx struct {
// contains filtered or unexported fields
}
GrpcOutCtx todo
func NewGrpcOutCtxFromHTTPRequest ¶
func NewGrpcOutCtxFromHTTPRequest(r *http.Request) (*GrpcOutCtx, error)
NewGrpcOutCtxFromHTTPRequest 从上下文中获取Token
func NewGrpcOutCtxFromIn ¶ added in v0.8.4
func NewGrpcOutCtxFromIn(in *GrpcInCtx) *GrpcOutCtx
NewGrpcOutCtxFromIn todo
func (GrpcOutCtx) SetAccessToken ¶
func (c GrpcOutCtx) SetAccessToken(ak string)
SetAccessToken todo
func (*GrpcOutCtx) SetNamesapce ¶ added in v0.8.3
func (c *GrpcOutCtx) SetNamesapce(ns string)
SetNamesapce todo
Click to show internal directories.
Click to hide internal directories.