caller

时间:2021-03-28 18:30:45
【文件属性】:
文件名称:caller
文件大小:8KB
文件格式:ZIP
更新时间:2021-03-28 18:30:45
Go 呼叫者 一个工具可以帮助编码器减少请求HTTP api的许多重复代码,并支持可选的config来修改请求和HTTP客户端的参数。 更重要的是,该工具支持静态api的响应主体通过函数进行解析,并接收到struct或map,slice的指针中。 另外,该工具支持接收struct,map,slice的指针来函数解析(默认是json)。 )api的响应体。 用法 默认 func TestCaller ( t * testing. T ) { ctx := context . Background () result := map [ string ] interface {}{} err := Get ( ctx , "http://127.0.0.1:8888/ping" ). Parse ( & result ) if err != nil { t . Fatal ( err )
【文件预览】:
caller-master
----parser.go(278B)
----global.go(1KB)
----error.go(1KB)
----retry.go(595B)
----caller_test.go(639B)
----result.go(2KB)
----config.go(2KB)
----bytes.go(276B)
----core.go(2KB)
----go.sum(1KB)
----README.md(1KB)
----caller.go(2KB)
----request.go(517B)
----go.mod(88B)

网友评论