Documentation ¶
Index ¶
- Variables
- func CtxCallArgs(ctx context.Context) cm.CallArgs
- func CtxCallId(ctx context.Context) cm.CallId
- func CtxCaller(ctx context.Context) cm.ServiceName
- func CtxSetCallArgs(ctx context.Context, ca cm.CallArgs) context.Context
- func CtxSetCallId(ctx context.Context, id cm.CallId) context.Context
- func CtxSetCaller(ctx context.Context, name cm.ServiceName) context.Context
- func CtxSetReadOnly(ctx context.Context, readOnly bool) context.Context
- func HashCallArgs(app string, method string, input []byte) string
- func HashCallArgsWithShard(app string, method string, input []byte) (string, int)
- func InitReqCtx(ctx context.Context, id cm.CallId, ca cm.CallArgs, caller cm.ServiceName, ...) context.Context
- func NonROWrapper[ReqType interface{}, RespType interface{}](handler func(context.Context, *ReqType) *RespType) func(http.ResponseWriter, *http.Request)
- func PostWrite(ctx context.Context, key cm.Key)
- func PreCall(ctx context.Context, ca cm.CallArgs) (cm.ReturnVal, bool)
- func PreRead(ctx context.Context, key cm.Key)
- func PreReqEnd(ctx context.Context, retVal cm.ReturnVal)
- func PreReqStart(ctx context.Context)
- func PreWrite(ctx context.Context, key cm.Key)
- func ROWrapper[ReqType interface{}, RespType interface{}](handler func(context.Context, *ReqType) *RespType) func(http.ResponseWriter, *http.Request)
- func ReadOnlyContext(ctx context.Context) bool
- func SetupCtxFromHTTPReq(r *http.Request, ro bool) (context.Context, []byte)
- type CtxItem
- type Deps
Constants ¶
This section is empty.
Variables ¶
View Source
var DEBUG_CA = false
Functions ¶
func CtxSetCaller ¶
func HashCallArgsWithShard ¶
func InitReqCtx ¶
func InitReqCtx(ctx context.Context, id cm.CallId, ca cm.CallArgs, caller cm.ServiceName, ro bool) context.Context
Helper function that initializes the ctx for the client It's used at the beginning of each request handler so PreReqStart is also merged into this function
func NonROWrapper ¶
func PreCall ¶
This returns true if cache was hit. The caller of this method needs to avoid the call if that is the case.
func PreReqStart ¶
func ReadOnlyContext ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.