一见

上一页 1 2 3 4 5 6 7 ··· 75 下一页

2024年1月26日 #

go-zero开发入门-初始化cache.ClusterConf示例

摘要: cache.ClusterConf 的定义如下: // CacheConf is an alias of ClusterConf. type CacheConf = ClusterConf type ( // A ClusterConf is the config of a redis cluste 阅读全文

posted @ 2024-01-26 10:14 -见 阅读(31) 评论(0) 推荐(0) 编辑

2024年1月25日 #

go-zero配置DB的redis缓存

摘要: 配置定义: # cat internal/config/config.go package config import ( "github.com/zeromicro/go-zero/rest" "github.com/zeromicro/go-zero/core/stores/cache" ) t 阅读全文

posted @ 2024-01-25 18:41 -见 阅读(87) 评论(0) 推荐(0) 编辑

2023年12月22日 #

csharp使用ChromiumWebBrowser页面出现黑边和鼠标偏离问题

摘要: 问题的原因是显示器同ChromiumWebBrowser的分辨率不一致,可在初始化时调用 EnableHighDPISupport 来解决: // 初始化配置 CefSettings settings = new CefSettings(); Cef.Initialize(settings); Ce 阅读全文

posted @ 2023-12-22 16:13 -见 阅读(37) 评论(0) 推荐(0) 编辑

2023年12月15日 #

go-zero开发入门之gateway深入研究1

摘要: 创建一个 gateway 示例: // main.go package main import ( "flag" "fmt" "gateway/middleware" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go- 阅读全文

posted @ 2023-12-15 17:58 -见 阅读(79) 评论(0) 推荐(0) 编辑

go-zero目录结构和说明

摘要: . ├── code-of-conduct.md 行为准则 ├── CONTRIBUTING.md 贡献指南 ├── core 框架的核心组件 │ ├── bloom 布隆过滤器,用于检测一个元素是否在一个集合中 │ ├── breaker 熔断器,用于防止过多的请求导致系统崩溃 │ ├── cmd 阅读全文

posted @ 2023-12-15 10:06 -见 阅读(123) 评论(0) 推荐(0) 编辑

2023年12月13日 #

go-zero开发入门之网关往rpc服务传递数据2

摘要: go-zero 的网关服务实际是个 go-zero 的 API 服务,也就是一个 http 服务,或者说 rest 服务。http 转 grpc 使用了开源的 grpcurl 库,当网关需要往 rpc 服务传递额外的数据,比如鉴权数据的时候,通过 http 的 header 进行: func Aut 阅读全文

posted @ 2023-12-13 21:49 -见 阅读(141) 评论(0) 推荐(0) 编辑

2023年12月12日 #

go-zero开发入门之网关往rpc服务传递数据1

摘要: go-zero 的网关往 rpc 服务传递数据时,可以使用 headers,但需要注意前缀规则,否则会发现数据传递不过去,或者对方取不到数据。 go-zero 的网关对服务的调用使用了第三方库 grpcurl,入口函数为 InvokeRPC: grpcurl.InvokeRPC(r.Context( 阅读全文

posted @ 2023-12-12 18:59 -见 阅读(121) 评论(0) 推荐(0) 编辑

2023年12月10日 #

go-zero开发入门-API网关鉴权开发示例

摘要: 本文是go-zero开发入门-API网关开发示例一文的延伸,继续之前请先阅读此文。 在项目根目录下创建子目录 middleware,在此目录下创建文件 auth.go,内容如下: // 鉴权中间件 package middleware import ( "context" "errors" "net 阅读全文

posted @ 2023-12-10 20:18 -见 阅读(172) 评论(0) 推荐(0) 编辑

2023年12月8日 #

go-zero开发入门-API服务开发示例

摘要: 接口定义 定义 API 接口文件 接口文件 add.api 的内容如下: syntax = "v1" info ( title: "API 接口文件示例" desc: "演示如何编写 API 接口文件" author: "一见" date: "2023年12月07日" version: "v1" ) 阅读全文

posted @ 2023-12-08 11:03 -见 阅读(116) 评论(0) 推荐(0) 编辑

go-zero开发入门-API网关开发示例

摘要: 开发一个 API 网关,代理 https://www.cnblogs.com/aquester/p/17882070.html 中的 RPC 服务。 网关完整源代码 // file: main.go package main import ( "flag" "fmt" "github.com/zer 阅读全文

posted @ 2023-12-08 10:13 -见 阅读(200) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 75 下一页

导航