# Functions
BytesToString converts byte slice to string without a memory allocation.
方法3校验是否存在[]的内容,里面是装的参数 由于可以通过反射获取到参数的类型,但是无法获得传递的参数名称 比如 name string 获的不了name,所以需要使用类似[!name string, !password string, !age int]这样的方式,然后可以对于参数是否必传做校验.
方法1校验注解内容是否包含: @GET @POST @HEAD @DELETE --- 等开头,然后表示可接收的类型 todo 将来可能支持多请求方式,返回的是httpmethond数组.
方法2校验是否存在类似/hello 内容的路由.
校验是否存在出参入残相关的注释,有的话返回true和parm入参数组和返回参数的数组一个完整的路由注释:[str1, str2, str3 *examples.DemoRest] [commentHi1 string,errHi1 error]如果复杂的情况,既包含请求头又包含请求体里面的内容的话,可以考虑这种写法:写两层内容,第一行是请求头,下方是请求体。如果请求体参数不止一个,则为表单方式提交?但是问题来了,如果只写一行,该如何认为呢?有可能是get请求,也可能会是表单提交-感觉会走不通另外一种方式,[]表示请求头里面的内容 { }表示请求体里面的内容 如果请求体参数很多,则为表单方式提交! todo 采用的方式{name , password string, age int, hiValue bind.ReqTest}[hi *bind.ReqTest].
No description provided by the author
No description provided by the author
No description provided by the author
这个是保留map重复的内容,取交集.
这个是保留map重复的内容,取合集.
随机生成controller对象的名称;todo 采用更加合理的方式.
No description provided by the author
数组倒序函数.
解析[!name string, !password string, !age int] 组装到annotation.Parm 结构体数组.
StringToBytes converts string to byte slice without a memory allocation.
# Variables
提供想该集合添加新的自定义头注解的方法.
自定义请求头,启动的时候可以往这里添加,然后注册rest的时候提前绑定.
注解方式 @req-custom.
No description provided by the author
注解方式:@resp-custom.
No description provided by the author
No description provided by the author
No description provided by the author
请求头可以由用户自定义修改,在utils内定义多个标准的请求头类型,用户可以直接使用标准的请求头类型配合标准的请求头注解。也可以使用非标准的请求头类型和非标准的请求头注解个性化拓展.
注解方式 @resp-stander.
No description provided by the author
# Structs
todo 自定义的特殊的rest注解,首先需要注册。根据tag为key,Attribute内为详细请求头信息,然后在获取restObj restMethod头上的注解之后,去根据注册的集合内查找是否有符合匹配,找到了的话就绑定请求头信息 todo 需要调整目前的header/Consumes/Produces 绑定策略, todo 优化目前设计,headers:请求和响应头;Consumes调整为requestHeaders;Produces调整为responseHeaders,结构都如下设计:tag+Attribute.
store the comment for the controller method.
路由规则信息.
rest obj 信息结构体.
router style list.路由规则列表,这个是存放rest结构体上边的注解的参数信息的实体.
No description provided by the author
ParmInfo 参数类型描述.
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
todo 下边是只支持rest obj的方式把 名称作为请求头的key,把tag信息作为value,其中的 , 作为分隔符;可以在dev的时候直接解析到router文件中,方便生成rest接口文档,然后生产环境直接加载.
No description provided by the author
# Type aliases
No description provided by the author
NewAPIFunc Custom context support.
RecoverErrorFunc recover 错误设置.