02 2022 档案

摘要:好处是配置可选,直观 type Server struct { Addr string Port int protocol string Timeout time.Duration MaxConn int TLS *tls.Config } type option func(*Server) fun 阅读全文
posted @ 2022-02-24 20:25 故意写bug 阅读(162) 评论(0) 推荐(0)
摘要:/* UndoIntSet是IntSet的功能扩展,可以进行undo操作 通过委托和反转控制将IntSet的逻辑和Undo的逻辑分开 undo的功能由委托给functions,这样可以实现IntSet依赖functions, */ type undo []func() func (u *undo) 阅读全文
posted @ 2022-02-24 20:17 故意写bug 阅读(228) 评论(0) 推荐(0)
摘要:func decorator(f func(s1 string))func(s2 string) { return func(s3 string) { fmt.Println("start") f(s3) fmt.Println("end") } } func hello(s string){ fm 阅读全文
posted @ 2022-02-24 20:08 故意写bug 阅读(139) 评论(0) 推荐(0)
摘要://产生数据 func makeData(min,max int)[]int{ data := make([]int,max-min+1) for i := range data{ data[i]=min+i } return data } //把输入的数据通过通道传递出去 func echo(nu 阅读全文
posted @ 2022-02-24 19:59 故意写bug 阅读(189) 评论(0) 推荐(0)
摘要:##visitor模式 //先定义一个需要访问的数据结构 type Info struct { Namespace string Name string OtherThings string } type VisitorFunc func(*Info,error)error //将访问数据的方法抽象 阅读全文
posted @ 2022-02-24 19:51 故意写bug 阅读(124) 评论(0) 推荐(0)
摘要:select的基本用法: 选择全部的字段和标签,使用默认的数据库和rp:select * from "h2o_feet" 选择特定的字段和标签,使用默认的数据库和rp:select "level description","location","water_level" from "h2o_feet 阅读全文
posted @ 2022-02-16 20:37 故意写bug 阅读(397) 评论(0) 推荐(0)
摘要:database:类似于关系数据库的数据库的概念,是用户,保留策略,持续查询,时序数据的容器 retention policy: 数据的保留策略,是一个database和measurement中间的东西 measurement: 类似于表, field key: 列名, field set: 列值的 阅读全文
posted @ 2022-02-13 20:25 故意写bug 阅读(113) 评论(0) 推荐(0)
摘要:安装:docker pull influxdb:1.8.10 使用: 进入容器,influx -precison rfc3339 建库:create database mydb 查询全部库: show databases 指定要使用的库: use mydb 插入:insert cpu,host=se 阅读全文
posted @ 2022-02-10 21:05 故意写bug 阅读(243) 评论(0) 推荐(0)