MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / GetContextKeyType

Function GetContextKeyType

common/gin.go:81–89  ·  view source on GitHub ↗
(c *gin.Context, key constant.ContextKey)

Source from the content-addressed store, hash-verified

79}
80
81func GetContextKeyType[T any](c *gin.Context, key constant.ContextKey) (T, bool) {
82 if value, ok := c.Get(string(key)); ok {
83 if v, ok := value.(T); ok {
84 return v, true
85 }
86 }
87 var t T
88 return t, false
89}
90
91func ApiError(c *gin.Context, err error) {
92 c.JSON(http.StatusOK, gin.H{

Callers 1

GenRelayInfoFunction · 0.92

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected