<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>编程语言 - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/</link><description>编程语言 - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Wed, 15 Jan 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/" rel="self" type="application/rss+xml"/><item><title>Python Http 客户端库</title><link>https://rd163.visword.com/posts/python-http-client-libs/</link><pubDate>Wed, 15 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-http-client-libs/</guid><description><![CDATA[<h2 id="urlliburllib2" class="headerLink">
    <a href="#urlliburllib2" class="header-mark"></a>urllib、urllib2</h2><p>Python2中早期使用的http库 urllib、urllib2 ，给我们提供了许多方便的功能。</p>
<h2 id="requests" class="headerLink">
    <a href="#requests" class="header-mark"></a>requests</h2><p>requests 是使用率非常高的 HTTP 库.</p>
<p>异常情况处理说明：</p>
<p>在发送HTTP请求获取数据的过程中，可能会遭遇以下异常:</p>]]></description></item><item><title>Conda的替代品</title><link>https://rd163.visword.com/posts/alternatives-for-conda/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/alternatives-for-conda/</guid><description><![CDATA[<h1 id="conda的替代品" class="headerLink">
    <a href="#conda%e7%9a%84%e6%9b%bf%e4%bb%a3%e5%93%81" class="header-mark"></a>Conda的替代品</h1><p>由于 Anaconda MiniConda 开始收费了，我们可以用 MiniForge 或 Mamba 来代替 Conda。</p>
<ul>
<li><a href="https://github.com/conda-forge/miniforge" target="_blank" rel="noopener noreferrer">Miniforge</a></li>
<li><a href="https://github.com/mamba-org/mamba" target="_blank" rel="noopener noreferrer">Mamba</a></li>
</ul>]]></description></item><item><title>Gin 开发后台服务最佳实践</title><link>https://rd163.visword.com/posts/best-practice-for-gin/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/best-practice-for-gin/</guid><description><![CDATA[<h1 id="gin-开发后台服务最佳实践" class="headerLink">
    <a href="#gin-%e5%bc%80%e5%8f%91%e5%90%8e%e5%8f%b0%e6%9c%8d%e5%8a%a1%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5" class="header-mark"></a>Gin 开发后台服务最佳实践</h1><p><a href="https://github.com/gin-gonic/gin" target="_blank" rel="noopener noreferrer">gin</a> 是一个 golang 实现的 http web 框架。</p>
<p><a href="https://github.com/skyhee/gin-doc-cn" target="_blank" rel="noopener noreferrer">go 语言框架 gin 的中文文档</a> 介绍了 路由、无缝重启、中间件、db接入常用方法。</p>
<h2 id="脚手架项目" class="headerLink">
    <a href="#%e8%84%9a%e6%89%8b%e6%9e%b6%e9%a1%b9%e7%9b%ae" class="header-mark"></a>脚手架项目</h2><p>github上有这么些 stars 数排名较高的：</p>
<ul>
<li>
<p><a href="https://github.com/flipped-aurora/gin-vue-admin" target="_blank" rel="noopener noreferrer">gin-vue-admin</a> Vite+Vue3+Gin拥有AI辅助的基础开发平台，支持TS和JS混用。它集成了JWT鉴权、权限管理、动态路由、casbin鉴权、显隐可控组件、分页封装、多点登录拦截、资源权限、上传下载、代码生成器、表单生成器和可配置的导入导出等开发必备功能。</p>]]></description></item><item><title>golang web framework - macaron</title><link>https://rd163.visword.com/posts/golang-macaron/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-macaron/</guid><description><![CDATA[<h1 id="golang-web-framework---macaron" class="headerLink">
    <a href="#golang-web-framework---macaron" class="header-mark"></a>golang web framework - macaron</h1><p><a href="https://github.com/go-macaron/macaron" target="_blank" rel="noopener noreferrer">macaron</a> 是 Golang 开发的 Web Framework， 与 gin、beego 起名。详细的中文文档参考这里：</p>
<ul>
<li><a href="https://go-macaron.com/zh-cn" target="_blank" rel="noopener noreferrer">macaron 文档</a></li>
</ul>
<p>提供了子网址的强大路由，可以嵌套多组路由器，提供热加载，修改模板就会立刻在页面修改，采用模块化设计，可以非常方便替换组件，采用依赖注入加载组件，非常适合现代化工程项目，代码松耦合，适合开发大型团队项目。</p>]]></description></item><item><title>Golang web框架</title><link>https://rd163.visword.com/posts/golang-web-framework/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-web-framework/</guid><description><![CDATA[<h1 id="golang-web框架" class="headerLink">
    <a href="#golang-web%e6%a1%86%e6%9e%b6" class="header-mark"></a>Golang web框架</h1><h2 id="fiber" class="headerLink">
    <a href="#fiber" class="header-mark"></a>fiber</h2><ul>
<li><a href="https://github.com/gofiber/fiber" target="_blank" rel="noopener noreferrer">fiber</a> Express inspired web framework written in Go</li>
</ul>
<p>基于Fiber的开源项目</p>
<ul>
<li><a href="https://github.com/Finb/bark-server" target="_blank" rel="noopener noreferrer">bark-server</a></li>
</ul>
<h2 id="macaron" class="headerLink">
    <a href="#macaron" class="header-mark"></a>macaron</h2><ul>
<li><a href="https://github.com/go-macaron/macaron" target="_blank" rel="noopener noreferrer">macaron</a></li>
</ul>
<h2 id="beego" class="headerLink">
    <a href="#beego" class="header-mark"></a>beego</h2><ul>
<li><a href="https://github.com/astaxie/beego" target="_blank" rel="noopener noreferrer">beego</a></li>
</ul>
<h2 id="gin" class="headerLink">
    <a href="#gin" class="header-mark"></a>gin</h2><ul>
<li><a href="https://github.com/gin-gonic/gin" target="_blank" rel="noopener noreferrer">gin</a></li>
</ul>
<h2 id="echo" class="headerLink">
    <a href="#echo" class="header-mark"></a>echo</h2><ul>
<li><a href="https://github.com/labstack/echo" target="_blank" rel="noopener noreferrer">echo</a></li>
</ul>
<h2 id="chi" class="headerLink">
    <a href="#chi" class="header-mark"></a>chi</h2><ul>
<li><a href="https://github.com/go-chi/chi" target="_blank" rel="noopener noreferrer">chi</a></li>
</ul>
<h2 id="gorilla" class="headerLink">
    <a href="#gorilla" class="header-mark"></a>gorilla</h2><ul>
<li><a href="https://github.com/gorilla/mux" target="_blank" rel="noopener noreferrer">gorilla</a></li>
<li><a href="https://github.com/gorilla/websocket" target="_blank" rel="noopener noreferrer">websocket</a> 最广泛使用的 WebSocket 库。</li>
</ul>
<h2 id="fasthttp" class="headerLink">
    <a href="#fasthttp" class="header-mark"></a>fasthttp</h2><ul>
<li><a href="https://github.com/valyala/fasthttp" target="_blank" rel="noopener noreferrer">fasthttp</a></li>
</ul>
<h2 id="httprouter" class="headerLink">
    <a href="#httprouter" class="header-mark"></a>httprouter</h2><ul>
<li><a href="https://github.com/julienschmidt/httprouter" target="_blank" rel="noopener noreferrer">httprouter</a></li>
</ul>
<h2 id="hertz" class="headerLink">
    <a href="#hertz" class="header-mark"></a>Hertz</h2><p>Hertz[həːts] 是一个 Golang 微服务 HTTP 框架，最初fork自fasthttp，并在设计时参考了其他开源框架gin、echo 的优势，并结合字节跳动内部的需求，使其具有高易用性、高 性能、高扩展性等特点，目前在字节跳动内部已广泛使用。如今越来越多的微服务选择使用 Golang，如果对微服务性能有要求，又希望框架能够充分满足内部的可定制化需求，Hertz 会是一个不错的选择。</p>]]></description></item><item><title>Golang 常用的程序库</title><link>https://rd163.visword.com/posts/golang-util-libs/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-util-libs/</guid><description><![CDATA[<h1 id="golang-常用的程序库" class="headerLink">
    <a href="#golang-%e5%b8%b8%e7%94%a8%e7%9a%84%e7%a8%8b%e5%ba%8f%e5%ba%93" class="header-mark"></a>Golang 常用的程序库</h1><h2 id="通用库" class="headerLink">
    <a href="#%e9%80%9a%e7%94%a8%e5%ba%93" class="header-mark"></a>通用库</h2><ul>
<li><a href="https://github.com/duke-git/lancet" target="_blank" rel="noopener noreferrer">lancet（柳叶刀</a> 是一个全面、高效、可复用的go语言工具函数库。 lancet受到了java apache common包和lodash.js的启发。</li>
</ul>
<h2 id="类型转换" class="headerLink">
    <a href="#%e7%b1%bb%e5%9e%8b%e8%bd%ac%e6%8d%a2" class="header-mark"></a>类型转换</h2><p><strong>cast</strong></p>]]></description></item><item><title>Golang 常用日志库</title><link>https://rd163.visword.com/posts/golang-log-libs/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-log-libs/</guid><description><![CDATA[<h1 id="golang-常用日志库" class="headerLink">
    <a href="#golang-%e5%b8%b8%e7%94%a8%e6%97%a5%e5%bf%97%e5%ba%93" class="header-mark"></a>Golang 常用日志库</h1><ul>
<li><a href="https://github.com/golang/glog" target="_blank" rel="noopener noreferrer">Google Glog 的Go语言版本</a></li>
<li><a href="https://github.com/uber-go/zap" target="_blank" rel="noopener noreferrer">zap 日志</a></li>
<li><a href="https://github.com/sirupsen/logrus" target="_blank" rel="noopener noreferrer">logrus</a></li>
<li><a href="https://github.com/mix-go/logrus" target="_blank" rel="noopener noreferrer">logrus 扩展</a></li>
</ul>]]></description></item><item><title>Golang 程序加载配置最佳实践</title><link>https://rd163.visword.com/posts/best-practice-for-go-conf/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/best-practice-for-go-conf/</guid><description><![CDATA[<h1 id="golang-程序加载配置最佳实践" class="headerLink">
    <a href="#golang-%e7%a8%8b%e5%ba%8f%e5%8a%a0%e8%bd%bd%e9%85%8d%e7%bd%ae%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5" class="header-mark"></a>Golang 程序加载配置最佳实践</h1><h2 id="常用配置文件读取方式" class="headerLink">
    <a href="#%e5%b8%b8%e7%94%a8%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e8%af%bb%e5%8f%96%e6%96%b9%e5%bc%8f" class="header-mark"></a>常用配置文件读取方式</h2><h3 id="1-json" class="headerLink">
    <a href="#1-json" class="header-mark"></a>1. json</h3><ul>
<li>内置</li>
<li><a href="https://github.com/json-iterator/go" target="_blank" rel="noopener noreferrer">json-iterator for go</a></li>
<li><a href="https://github.com/tidwall/gjson" target="_blank" rel="noopener noreferrer">GJSON </a></li>
</ul>
<h3 id="2-yaml" class="headerLink">
    <a href="#2-yaml" class="header-mark"></a>2. yaml</h3><ul>
<li><a href="https://github.com/go-yaml/yaml" target="_blank" rel="noopener noreferrer">YAML</a></li>
</ul>
<h3 id="3-toml" class="headerLink">
    <a href="#3-toml" class="header-mark"></a>3. toml</h3><ul>
<li><a href="https://github.com/BurntSushi/toml" target="_blank" rel="noopener noreferrer">TOML</a></li>
</ul>
<h3 id="4-ini" class="headerLink">
    <a href="#4-ini" class="header-mark"></a>4. ini</h3><ul>
<li><a href="https://github.com/go-ini/ini" target="_blank" rel="noopener noreferrer">INI</a></li>
</ul>
<h3 id="5-hcl" class="headerLink">
    <a href="#5-hcl" class="header-mark"></a>5. HCL</h3><ul>
<li><a href="https://github.com/hashicorp/hcl" target="_blank" rel="noopener noreferrer">HCL</a></li>
</ul>
<h3 id="其它库" class="headerLink">
    <a href="#%e5%85%b6%e5%ae%83%e5%ba%93" class="header-mark"></a>其它库</h3><ul>
<li><a href="https://github.com/spf13/viper" target="_blank" rel="noopener noreferrer">Viper</a> Viper是一个完全配置解析库，可以支持上面所有类型的配置文件的解析。</li>
</ul>
<h2 id="最佳实践" class="headerLink">
    <a href="#%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5" class="header-mark"></a>最佳实践</h2><p>最好的方式应该是能够同时支持 从 命令行参数、配置文件、环境变量 三种方式加载参数写入到特定的结构中。</p>]]></description></item><item><title>Golang 服务相关的库</title><link>https://rd163.visword.com/posts/golang-service-libs/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-service-libs/</guid><description><![CDATA[<h1 id="golang-服务相关的库" class="headerLink">
    <a href="#golang-%e6%9c%8d%e5%8a%a1%e7%9b%b8%e5%85%b3%e7%9a%84%e5%ba%93" class="header-mark"></a>Golang 服务相关的库</h1><ul>
<li><a href="https://github.com/zeromicro/go-zero" target="_blank" rel="noopener noreferrer">go-zero 一个集成了各种工程实践的 web 和 rpc 框架</a></li>
<li><a href="https://github.com/trpc-group/trpc-go" target="_blank" rel="noopener noreferrer">trpc-go</a></li>
<li><a href="https://github.com/gin-gonic/gin" target="_blank" rel="noopener noreferrer">gin</a></li>
<li><a href="https://github.com/beego/beego" target="_blank" rel="noopener noreferrer">Beego </a></li>
<li><a href="https://github.com/grpc-ecosystem/grpc-gateway" target="_blank" rel="noopener noreferrer">gRPC-Gateway gRPC to JSON proxy generator following the gRPC HTTP spec</a></li>
</ul>
<h2 id="参考" class="headerLink">
    <a href="#%e5%8f%82%e8%80%83" class="header-mark"></a>参考</h2><ul>
<li><a href="https://www.liwenzhou.com/posts/Go/grpc-gateway/" target="_blank" rel="noopener noreferrer">gRPC-Gateway使用指南</a></li>
</ul>]]></description></item><item><title>Golang 模板</title><link>https://rd163.visword.com/posts/golang-template/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-template/</guid><description><![CDATA[<h1 id="golang-模板" class="headerLink">
    <a href="#golang-%e6%a8%a1%e6%9d%bf" class="header-mark"></a>Golang 模板</h1><h2 id="标准库实现" class="headerLink">
    <a href="#%e6%a0%87%e5%87%86%e5%ba%93%e5%ae%9e%e7%8e%b0" class="header-mark"></a>标准库实现</h2><p>参考</p>
<ul>
<li><a href="https://www.cnblogs.com/f-ck-need-u/p/10053124.html" target="_blank" rel="noopener noreferrer">Go标准库：Go template用法详解 </a></li>
<li><a href="https://www.cnblogs.com/f-ck-need-u/p/10035768.html" target="_blank" rel="noopener noreferrer">Go标准库：深入剖析Go template </a></li>
</ul>
<p><strong>踩坑记录</strong></p>
<p>模板默认会对一些参数进行转义，因此渲染后的字符串可能与预期不符。</p>]]></description></item></channel></rss>