摘要: api-1 package main import ( "context" "fmt" "github.com/gin-gonic/gin" "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin" 阅读全文
posted @ 2024-06-18 16:14 朝阳1 阅读(249) 评论(0) 推荐(0)
摘要: client package main import ( "context" "fmt" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" 阅读全文
posted @ 2024-06-18 16:12 朝阳1 阅读(189) 评论(0) 推荐(0)
摘要: 之前做过这个,时间久了就忘记了。这里做个笔记 jaeger自行安装,由于最近docker镜像都失效了,只能去GitHub自己下载二进制,或者你懂得。。 项目目录 local.go package main import ( "context" "log" "time" "go.opentelemet 阅读全文
posted @ 2024-06-18 16:11 朝阳1 阅读(139) 评论(0) 推荐(0)
摘要: 之前一直写php,写过php的人都知道php里面字符串、数组函数好用的非常多,转到go之后,写代码难免会受到一些影响 https://www.php2golang.com/ 这个网站就是可以把常见的php函数转成go实现,当然也不一定全部都有 比如 strstr函数 阅读全文
posted @ 2024-06-18 14:39 朝阳1 阅读(46) 评论(0) 推荐(0)
摘要: 方法1 直接在git后台设置xxx分支为保护分支就可以了,比如master 方法2,进入到项目文件夹 cd .git/hooks/ cp pre-commit.sample pre-commit 在最前面加上代码,master可以替换对应分支 #!/bin/sh branch="$(git rev- 阅读全文
posted @ 2024-06-18 14:33 朝阳1 阅读(194) 评论(0) 推荐(0)
摘要: 普通版本 package main import ( "fmt" "github.com/afex/hystrix-go/hystrix" "github.com/gin-gonic/gin" "net/http" "time" ) func helloHandler(c *gin.Context) 阅读全文
posted @ 2024-06-18 14:06 朝阳1 阅读(83) 评论(0) 推荐(0)
摘要: 这里测试最基本的,服务发现的那种需要魔法,我的虚拟机不行,示例去官网的example查看 p2p.go go get 安装缺失的库 package main import ( "bufio" "context" "crypto/rand" "flag" "fmt" "io" "log" mrand 阅读全文
posted @ 2024-06-18 10:42 朝阳1 阅读(74) 评论(0) 推荐(0)