--- title: 学习周刊-总第184期-2024年第45周 date: 2024-11-07 23:07:53 permalink: /pages/88fc71/ categories: - 周刊 - 学习周刊 - 2024年 tags: - feed: enable: true description: 如要阅读全文,点击标题跳转。学习周刊-总第184期 | gomplate | knife4j | knife4go | minimalist-saas | LeapLedger --- ### 0 ,前言 周刊维护在:[https://github.com/eryajf/learning-weekly](https://github.com/eryajf/learning-weekly) 欢迎投稿,推荐或自荐项目 /文章 /博客,请提交 issue 。 周刊核心为运维周刊,还会侧重Go语言生态,Vue相关技术生态的项目,以及 GitHub 上优秀项目或经验。 你也可以在我的博客 [https://wiki.eryajf.net/learning-weekly/](https://wiki.eryajf.net/learning-weekly/) 查看汇总周刊。 🔥 有不少人想单独从博客通过 RSS 订阅周刊的更新,现在它来了,你可以使用这个[🔗 链接](https://wiki.eryajf.net/learning-weekly.xml)进行订阅。 ### 1,优秀项目 --- - 项目地址:[gomplate](https://github.com/hairyhenderson/gomplate) - 项目说明:一个功能强大的 go 语言模板库,一些用法见下边例子。 ```sh $ # at its most basic, gomplate can be used with environment variables... $ echo 'Hello, {{ .Env.USER }}' | gomplate Hello, hairyhenderson $ # but that's kind of boring. gomplate has tons of functions to do useful stuff, too $ gomplate -i 'the answer is: {{ mul 6 7 }}' the answer is: 42 $ # and, since gomplate uses Go's templating syntax, you can do fun things like: $ gomplate -i '{{ range seq 5 1 }}{{ . }} {{ if eq . 1 }}{{ "blastoff" | toUpper }}{{ end }}{{ end }}' 5 4 3 2 1 BLASTOFF $ # the real fun comes when you use datasources! $ cat ./config.yaml foo: bar: baz: qux $ gomplate -d config=./config.yaml -i 'the value we want is: {{ (datasource "config").foo.bar.baz }}' the value we want is: qux $ # datasources are defined by URLs, and gomplate is not limited to just file-based datasources: $ gomplate -d ip=https://ipinfo.io -i 'country code: {{ (ds "ip").country }}' country code: CA $ # standard input can be used as a datasource too: $ echo '{"cities":["London", "Johannesburg", "Windhoek"]}' | gomplate -d city=stdin:///in.json -i '{{ range (ds "city").cities }}{{.}}, {{end}}' London, Johannesburg, Windhoek, $ # and here's something a little more complicated: $ export CITIES='city: [London, Johannesburg, Windhoek]' $ cat in.tmpl {{ range $i, $city := (ds "cities").city -}} {{ add 1 $i }}: {{ include "weather" (print $city "?0") }} {{ end }} $ gomplate -d 'cities=env:///CITIES?type=application/yaml' -d 'weather=https://wttr.in/?0' -H 'weather=User-Agent: curl' -f in.tmpl 1: Weather report: London \ / Partly cloudy _ /"".-. 4-7 °C \_( ). ↑ 20 km/h /(___(__) 10 km 0.0 mm 2: Weather report: Johannesburg \ / Partly cloudy _ /"".-. 15 °C \_( ). ↘ 0 km/h /(___(__) 10 km 2.2 mm 3: Weather report: Windhoek \ / Partly cloudy _ /"".-. 20 °C \_( ). ↑ 6 km/h /(___(__) 20 km 0.0 mm ``` --- - 项目地址:[knife4j](https://github.com/xiaoymin/knife4j) - 项目说明:该项目是集成 Swagger 生成 Api 文档的增强解决方案,更加好看,功能更丰富强大。 ![](https://t.eryajf.net/imgs/2024/10/1730271557460.webp) --- - 项目地址:[knife4go](https://github.com/go-webtools/knife4go) - 项目说明:顾名思义,这个项目是一个可以让你的 go 项目,快速集成如上项目的工具库。前提是你的项目框架使用的是 gin 框架。 --- - 项目地址:[minimalist-saas](https://github.com/lmq2582609/minimalist-saas) - 项目说明:极简多租户管理系统是一个基于 SpringBoot3 + Vue3 打造的前后端分离的 Java 快速开发脚手架,基于数据库字段隔离的多租户管理系统,具备常规基础功能的单体应用。 ![](https://t.eryajf.net/imgs/2024/10/1730271849669.webp) --- - 项目地址:[LeapLedger](https://github.com/ZiRunHua/LeapLedger) - 项目说明:一个的前后端分离免费开源的记账软件,服务端使用 `Gin` 框架,基于 `Nats`、`Mysql`、`Redis` 实现,带来快速的响应和稳定的服务。使用 `docker` 即可快速部署和构建客户端安装包。客户端基于 flutter 构建。 ![](https://t.eryajf.net/imgs/2024/10/1730272105920.webp) --- ::: note 申明 **原创文章,未经授权,严禁转载,侵权必究!此乃文中随机水印,敬请读者谅解。** ::: right Copyright [二丫讲梵](https://wiki.eryajf.net) 版权所有 ::: ### 2,优秀文章 --- - [小米15手机(澎湃OS2):如何关闭推荐广告](https://www.dolingou.com/article/xiaomi-15-close-recommended-ads-tutorial) - 如题,关闭之后会发现,仿佛进入了一个新世界。 --- - [最好的解决办法就是请人吃饭](https://4311346.com/post/2024/1104-inviting.html) - 有意思的文章,结合其他博友的文章与自己的生活进行点评,是一个不错的形式。 --- ### 3,优秀博客 --- - 博客地址:[璎耜](https://simply-none.github.io/latest-blogs/) - 简单说明:该博客是作者记录工作、居家过程中学习到的知识点与一些人生思考。 --- - 博客地址:[程序员大勇](https://www.afunny.top/) - 简单说明:前端开发者,博客折腾的很不错。 ---