上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: 这里是对接口在汇编层面上转换和实现的小结,详细了解可参考 Go 语言接口的原理 1. 类型转换:结构体到接口 1.1 结构体方法实现接口 package main type Duck interface { Quack() } type Cat struct { Name string } //go 阅读全文
posted @ 2022-03-30 00:02 lubanseven 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 在 小白学标准库之反射 reflect 篇中介绍了接口和反射。然而,对于接口的类型转换,底层实现还是一知半解。在参考 Go 语言设计与实现 这本书接口章节时,又看不大懂。一个拦路虎摆在面前:汇编。不懂汇编谈接口始终觉得有点虚,于是抱着死啃这块大骨头的心态开始了汇编学习之路。要知道,作为一个严肃的 G 阅读全文
posted @ 2022-03-22 22:56 lubanseven 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1. 部署报错:The requested fsGroup is 123, but the volume local-pv-c7ef339e has GID 1000710000. The volume may not be shareable. 问题描述: 部署 CNF(pod 集群) 时,pod 阅读全文
posted @ 2022-03-12 21:17 lubanseven 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 这篇概述是看文章提到的一段话 xxx is not targeted to be horizontally scalable 引发的,遂整理记录在这里。 起因是有两个应用,一个是无状态的,可以 horizontally scalable,另一个是有状态的,和数据库绑定,horizontally sc 阅读全文
posted @ 2022-02-19 16:40 lubanseven 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1. OpenShift 内部 image registry Openshift 自带内部 image registry,可通过 podman 实现 image 的 pull 和 push 操作。 对不同操作,需要给用户指定相应的 role: // podman pull oc policy add 阅读全文
posted @ 2022-02-17 21:42 lubanseven 阅读(777) 评论(0) 推荐(0) 编辑
摘要: Go 使用 encoding/json 包的 marshal 和 unmarshal 实现 json 数据的编解码。分别记录如下: 1. marshal 定义结构体: type OCP struct { Name string `json:"name"` ImageRegistry *ImageRe 阅读全文
posted @ 2022-02-16 23:16 lubanseven 阅读(469) 评论(0) 推荐(0) 编辑
摘要: 0. 前言 OpenShift image registry 概述 介绍了 OpenShift 平台上 registry 的基本结构。进一步地,本文将介绍在 Kubernetes 平台上,如何使用 Go 实现 image 的 push 操作。 1. 本地 CLI push image 在本地将 im 阅读全文
posted @ 2021-12-19 21:14 lubanseven 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 0. 前言 docker 镜像管理之 overlay2 最佳实践 中介绍了 image 的底层逻辑联合文件系统和分层结构。 image 存储在 registry 中,对于不同平台使用 registry 的策略有所区别。本文基于 RedHat 的 OpenShift 平台,对 registry 做概述 阅读全文
posted @ 2021-12-19 00:40 lubanseven 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 1. revision v0.0.0: unknown revision v0.0.0 go get -u github.com/uudashr/gopkgs/cmd/gopkgs 报错: [root@lubanseven home]$ go get -u github.com/uudashr/go 阅读全文
posted @ 2021-12-16 22:31 lubanseven 阅读(7028) 评论(2) 推荐(2) 编辑
摘要: 1. 前言 在 Go 语言中,上下文 context.Context 用来设置截止日期,同步信号,传递值的功能,它与 goroutine 关系密切,被用来解决 goroutine 之间 退出通知,元数据传递 等的任务。本文通过示例代码来学习梳理 context.Context 包,希望做到从入门到深 阅读全文
posted @ 2021-12-15 13:21 lubanseven 阅读(760) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页