上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: package commimport ( "crypto/aes" "crypto/cipher" "crypto/md5" "encoding/base64" "encoding/binary" "errors" "fmt" "lottery/conf" "math/rand" "strconv" 阅读全文
posted @ 2023-09-05 16:16 lisus2000 阅读(21) 评论(0) 推荐(0) 编辑
摘要: iris接入数据库,这里在XORM组件为例 conf的配置文件如下 这里面具体的配置了数据库的各种信息。 阅读全文
posted @ 2023-09-05 16:14 lisus2000 阅读(64) 评论(0) 推荐(0) 编辑
摘要: iris.context的结构体如下 以该结构体建立的主要方法有如下,以下列出一些常用的方法 剩余具体的方法见源码,源码位置: 使用方法示例 阅读全文
posted @ 2023-09-05 16:06 lisus2000 阅读(11) 评论(0) 推荐(0) 编辑
摘要: IRIS路由注册 实例化完Application对象,接着就是路由注册了。也就是类似下面的代码 看看api.Get 实现 我们主要看app.Get("/home", HomeHandler)这个函数的实现。进入该Get函数的源码,发现调用者是APIBuilder结构体,如下: 这是因为在Applic 阅读全文
posted @ 2023-09-04 18:02 lisus2000 阅读(17) 评论(0) 推荐(0) 编辑
摘要: iris路由实现原理 首先,我们看iris.New函数的作用。该函数就是创建了一个Application结构体的实例 app。然后后面的操作都是基于该实例 app 进行的操作。下面是该Application结构体的主要字段, 在Application的字段中,从名字上看有两个字段是和路由相关的:ro 阅读全文
posted @ 2023-09-04 15:43 lisus2000 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1.NEW函数分析 iris.go 其中 router.NewRouter()初始化了一个默认路由router.go 2.RUN函数分析 (1)首先分进行app.build,构建一次可设置框架 app.build的函数如下 如果有用到视图的话,默认要建立视图的目录和模板,不在的话引用会报如下错误 h 阅读全文
posted @ 2023-09-04 14:38 lisus2000 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-08-04 18:00 lisus2000 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-08-04 17:23 lisus2000 阅读(2) 评论(0) 推荐(0) 编辑
摘要: package mainimport "fmt"func main() { array := []int{1, 5, 9, 15, 81, 89, 123, 189, 333} target := 500 result := BinarySearch(array, target, 0, len(ar 阅读全文
posted @ 2023-08-02 16:06 lisus2000 阅读(7) 评论(0) 推荐(0) 编辑
摘要: Es中处理父子关系的两种方式 1.nested类型 将goods类型设置为nested 这时候就可以查到数据了。 2.join类型 在mapping中指定字段类型为join 定义父子关系属性 PUT order{ "settings": { "number_of_shards": 1, "numbe 阅读全文
posted @ 2023-03-30 18:56 lisus2000 阅读(101) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页