摘要: 首先安装 air 运行命令:go install github.com/cosmtrek/air@latest 项目根目录创建 air 配置文件:.air.conf # .air.conf 文件内容 root = "." tmp_dir = "tmp" [build] # Just plain ol 阅读全文
posted @ 2022-11-14 17:15 Silent-Cxl 阅读(216) 评论(0) 推荐(0)
摘要: URL:^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.\[\]\{\},?=%&;$:/~\+#]*[\w\-\[\]\{\}\?=%&;$/~\+#])?$ 阅读全文
posted @ 2022-10-20 11:13 Silent-Cxl 阅读(20) 评论(0) 推荐(0)
摘要: 编写 proto 文件 // role.proto 文件 syntax = "proto3"; option go_package = "./marketing"; package marketing; message RoleCreateReq { string role_name = 1; } 阅读全文
posted @ 2022-07-29 17:29 Silent-Cxl 阅读(1117) 评论(0) 推荐(0)
摘要: |占位符 | 说明 | 举例 | 输出| | | | | | |%v | 相应值的默认格式。 | Printf("%v", site),Printf("%+v", site) | {studygolang},{Name:studygolang} 在打印结构体时,“加号”标记(%+v)会添加字段名| 阅读全文
posted @ 2022-07-18 17:10 Silent-Cxl 阅读(114) 评论(0) 推荐(0)
摘要: 问题:mac 安装的 virtualbox 虚拟机,通过 vboxsf 文件共享系统将本机项目文件共享至虚拟机,虚拟机中通过 docker 容器运行了 nginx 项目,访问项目时返回 404,查看项目 nginx 错误日志:permission denied。 解决:先查询虚拟机 vboxsf 用 阅读全文
posted @ 2022-07-01 20:43 Silent-Cxl 阅读(446) 评论(0) 推荐(0)
摘要: 资源清单格式 apiVersion: group/apiversion # 如果没有给定 group 名称,那么默认为 core,可以使用 kubectl api-versions # 获取当前 k8s 版本上所有的 apiVersion 版本信息( 每个版本可能不同 ) kind: #资源类别 m 阅读全文
posted @ 2022-06-29 16:34 Silent-Cxl 阅读(56) 评论(0) 推荐(0)
摘要: kube-proxy开启ipvs的前置条件 modprobe br_netfilter cat > /etc/sysconfig/modules/ipvs.modules <<EOF #!/bin/bash modprobe -- ip_vs modprobe -- ip_vs_rr modprob 阅读全文
posted @ 2022-06-28 14:37 Silent-Cxl 阅读(860) 评论(0) 推荐(0)
摘要: 笔记来源 设置系统主机名以及 Host 文件的相互解析 hostnamectl set-hostname k8s-master01 安装依赖包 yum install -y conntrack ntpdate ntp ipvsadm ipset iptables curl sysstat libse 阅读全文
posted @ 2022-06-28 14:32 Silent-Cxl 阅读(177) 评论(0) 推荐(0)
摘要: nginx 配置文件 server { listen 80; server_name xxxxxxxx.com; root /path to app; access_log /data/log/nginx/access.log; error_log /data/log/nginx/error.log 阅读全文
posted @ 2021-12-23 15:52 Silent-Cxl 阅读(265) 评论(0) 推荐(0)
摘要: 解决方式: 无需设置 default-checked-keys 属性 读取到接口数据后使用 this.$refs.tree.setCheckedNodes(***传入接口返回的节点 keys***) 设置默认; 提交前使用 this.$refs.tree.getCheckedKeys() 再次获取选 阅读全文
posted @ 2021-12-01 11:29 Silent-Cxl 阅读(2977) 评论(0) 推荐(0)