Kratos Kratos 是一个轻量级的微服务框架,使用 Go 语言编写,官方文档地址: https://go-kratos.dev/docs/ Kratos 核心组件图: Kratos 核心组件说明: APIs:协议通信以 HTTP/gRPC 为基础,通过 Protobuf 进行定义; E[......] 继续阅读
Kratos Kratos 是一个轻量级的微服务框架,使用 Go 语言编写,官方文档地址: https://go-kratos.dev/docs/ Kratos 核心组件图: Kratos 核心组件说明: APIs:协议通信以 HTTP/gRPC 为基础,通过 Protobuf 进行定义; E[......] 继续阅读
Kratos Kratos is a lightweight microservice framework written in Go. The official documentation can be found at: https://go-kratos.dev/docs/ Kratos co[......] 继续阅读
goioc 介绍 goioc 是一个基于 GO 语言编写的依赖注入框架,基于反射进行编写。 支持泛型; 简单易用的 API; 简易版本的对象生命周期管理,作用域内对象具有生命; 延迟加载,在需要的时候才会实例化对象; 支持结构体字段注入,多层注入; 对象实例化线程安全,作用域内只会被执行一次。 [......] 继续阅读
Introduction to goioc goioc is a dependency injection framework written in Go language that is based on reflection. Supports generics; Simple and eas[......] 继续阅读
建立链路 SDK 官方仓库地址: https://github.com/open-telemetry/opentelemetry-go 设计一个这样的执行流程: Run 先后执行 Run1、Run2: a.Run1(newCtx) a.Run2(newCtx) Run1 中,还执行[......] 继续阅读
Establishing Link SDK Official Repository Address: https://github.com/open-telemetry/opentelemetry-go Design an execution flow like this: Run execute[......] 继续阅读
package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notificatio[......]继续阅读
使用示例: package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notifications. // W[......]继续阅读
Usage Common log methods in Go: Print/Printf/Println : Print log information Panic/Panicf/Panicln : Print log information and call Panic with the form[......]继续阅读
使用 Go 中常用的 log 方法: Print/Printf/Println : 打印日志信息 Panic/Panicf/Panicln : 打印日志信息后,以拼装好的字符串为参数调用 Panic Fatal/Fatalf/Fatalln : 打印日志信息后,os.Exit(1) 退出程序 New[......] 继续阅读
package main import ( "context" "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes&q[......]继续阅读
package main import ( "context" "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/t[......]继续阅读
In the following example, the timer sends a message to the channel every 1 second. It will automatically terminate when the count reaches 10 times. fu[......]继续阅读
在下面这个示例中,定时器每 1 秒向 channel 发生一次消息。当数量达到 10 次时,会自动终止。 func main() { fmt.Println("Commencing countdown.") tick := time.Tick(1 * time.Second)[......]继续阅读
[TOC] Background Actually, I've been planning to write this article for a while, but I've been quite lazy, so I've kept delaying it. Recently, updates[......] 继续阅读
[TOC] 背景 其实,规划这篇文章有一段时间了,但是比较懒,所以一直拖着没写。 最近时总更新太快了,太卷了,所以借着 .NET 7 正式版发布,熬夜写完这篇文章,希望能够追上时总的一点距离。 本文主要介绍如何在 .NET 和 Go 语言中如何生成系统(Windows)动态链接库,又如何从代码中引用[......] 继续阅读
基础 Go Web 的表单类型有三种: r.Form r.PostForm r.MultipartForm PostForm 支持 form-data 和 x-www-form-urlencoded 两种请求体,但是不支持上传文件。 MultipartForm 只支持 for[......] 继续阅读
Basics There are three types of forms in Go Web: r.Form r.PostForm r.MultipartForm PostForm supports form-data and x-www-form-urlencoded request b[......] 继续阅读
[TOC] 笔者前段时间在学习数据结构时,恰好听说了 LSM Tree,于是试着通过 LSM Tree 的设计思想,自己实现一个简单的 KV 数据库。 代码已开源,代码仓库地址:https://github.com/whuanle/lsm 笔者使用 Go 语言来实现 LSM Tree 数据库,因为[......] 继续阅读