cfssh, Q&A

为了使用cfssl工具自签发证书,并设置不同的有效期,你需要创建JSON配置文件来指定证书的属性,包括有效期。以下是生成根证书、服务端证书和

Go Web App, how to play?

优雅重启HTTP服务 目的 1、不关闭现有连接(正在运行中的程序) 2、新的进程启动并替代旧进程 3、新的进程接管新的连接 4、连接要随时响应用户的请

Go concurrent, how to play?

introduction 首先,让我们来理解一下 goroutine。Goroutine 是一种轻量级的线程,由 Go 运行时环境管理。在 Go 语言中,你可以通过关键字 go 来启动一

Go function interface, how to play?

接口型函数 在 Go 语言中,函数也可以作为接口的一部分,这种称为函数接口(Function Interface)的概念让我们可以更加灵活地定义接口和

Go function option vs builder, how to play?

Go 构建对象模式 Function Option 是一种通过函数选项来配置函数参数的方式。通过在函数中定义多个接受选项参数的函数,可以根据需要选择性地传递这些选项,而不是像

Go tools, how to play?

Delve是一个基于命令行的Go语言调试器,它提供了类似于GDB的功能,支持设置断点、单步执行、查看变量值、调用堆栈等操作。相比于GDB,D

Go 高级编程, how to play?

1. 并发编程 在这一部分主要介绍了Go语言的并发模型和相关的并发编程技术,包括协程、通道、互斥锁、条件变量等。关键知识点包括: 协程的基本用法和实

Go test, how to play?

go 测试 go test 后面接着的应该是一个包名 go test 可以生成覆盖率的profile文件,这个文件可以被go tool cover工具解析(go tool cover -func=cover.out/go tool cover -html=cover.out) 1、Go top-level

Go Effective, how to play?

1、介绍 Effective Go是Go语言官方提供的一份指南,旨在帮助开发人员写出高效、清晰和可读性强的Go代码。下面我会针对每个观点进行阐述,并给出相应的代

Go fundamentals, how to play?

Go Fundamentals 是更多的Go基础知识,涵盖了数据结构(基础数据结构、数组、slice、map)、语言基础(函数、接口、反射)、关键字和并发等方面。掌握这

Go Proverbs, how to play?

需要牢记这些谚语,在使用过程中感受谚语带来的变化 Don’t communicate by sharing memory, share memory by communicating. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package main import "fmt" func main() { channel := make(chan int) // 创建一个通道 go func() { value

docker, net?

docker 默认的网络设备 1 2 3 4 # 列出不同的网络设备 docker network ls # 专门查看网桥设备 brctl show 如果你的docker主机可以访问互联网,你会发现,容器创建后,默认也

micro quick, how to play?

工程化 简单模板: gin-vue-admin 自定义: nunu+vue3+el 微服务: IDL(声明+代码+文档+错误),kratos 统一服务端回复信息格式 micro: http+json 1 2 3 4 5 6 7 func (e *Helloworld) Call(ctx context.Context, req *pb.CallRequest, rsp *pb.CallResponse)

micro, how to play api?

API工程化:基于Proto的IDL管理和文档生成 在现代软件开发中,API工程化变得愈发重要。使用Proto作为接口定义语言(IDL),可以

micro, how to play engineer?

grpc管理 api管理 api生命周期管理 南北流量如何slb、cdn打通 东西流量内网鉴权、api上下线、api兼容性测试 微服务治理框架(实际就

micro, how to play select engineer mode?

MVC vs DDD MVC 在MVC架构中,控制器负责决定流量的传递路径,从用户请求开始,通过控制器、模型和视图之间的协作,最终将结果返回给用户。控制器作为中心

Go-micro advance, how to play?

疑问 服务发现,一个服务注册到consul/etcd,客户端怎么感知到 利用注册中心的订阅能力。客户端使用 Subscribe 方法来订阅服务更新的事件。该方法接收

Go-micro cli, how to play?

Go-micro 简介 一句话介绍 Go Micro CLI is the command line interface for developing Go Micro projects. 开始表演 安装 1 go install github.com/go-micro/cli/cmd/go-micro@latest 创建测试项目(执行命令,后续根据命令提示操作) 1 go-micro new service helloworld 创建工程化项目(执行命

Go-micro, how to play introduction?

Go-micro 简介 一句话介绍 Go Micro is a framework for distributed systems development. 多说两句 Go Micro provides the core requirements for distributed systems development including RPC and Event driven communication. The Go Micro philosophy is sane defaults with a pluggable architecture. We provide defaults to get you started quickly but everything can be easily swapped out. 介绍下具体功能

git 合并原理

git 合并原理 一、场景描述 记录一些常用操作 git status: 显示工作区和暂存区的状态 git diff: 显示工作区和暂存区之间的差异 git diff –cached: 显示暂存区和最新提交之间的差异 git diff [

git 常用操作

git 常用操作 一、场景描述 记录一些常用操作 git status: 显示工作区和暂存区的状态 git diff: 显示工作区和暂存区之间的差异 git diff –cached: 显示暂存区和最新提交之间的差异 git diff [

Kubernetes, how to deploy?

汇总kubernetes部署的方案: kubernetes < 1.20 + centos7 + docker + iptables + flannel kubernetes < 1.20 + centos7 + docker + ipvs + calico 1.20 <kubernetes < 1.24 + centos7 + docker + ipvs + calico kubernetes > 1.24 + centos7 + containerd + ipvs + calico kubernetes > 1.24 + centos7 + cri-o

gcr.io 镜像,how to play?

常用镜像仓库 DockerHub镜像仓库 Docker Hub 官方镜像仓库 (https://hub.docker.com/) Google 镜像仓库 https://gcr.io/google-containers/ https://gcr.io/kubernetes-helm/ https://gcr.io/google-containers/pause CoreOS 镜像仓库 https://quay.io/repository/coreos/ Elastic 镜像仓库 https://www.docker.elastic.co/ RedHat 镜像仓库 https://catalog.redhat.com/software/containers/search 阿里云镜像仓库 https://cr.console.aliyun.com/ 华为云镜像仓库 https://console.huaweicloud.com/swr/

kubernetes admission,how to play?

admission 一、static admission controllers 官方内置,启用就行 二、dynamic admission controllers 官方介绍 简单流程: 创建一个web服务(tls) 自签发证书 创建Dockerfil

kubernetes1.24.0, Why use docker in production environment ?

kubernetes1.24.0, Why use docker in production environment ? if you consider Mirantis and Docker have committed to maintaining a replacement adapter for Docker Engine, and to maintain that adapter even after the in-tree dockershim is removed from Kubernetes. The replacement adapter is named cri-dockerd. Download the cri-dockerd binary package or compile the source code yourself 1 2 3 4 5 6 # download file wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.2.0/cri-dockerd-v0.2.0-linux-amd64.tar.gz # unzip file tar -xvf cri-dockerd-v0.

Go io, how to play?

Go 的IO 首要问题,内核中的缓冲和进程中的缓冲 内核中的缓冲 无论进程是否提供缓冲,内核都是提供缓冲的,系统对磁盘的读写都会提供一个缓冲(page

Jenkins, hot backup

jenkins 数据热备 rsync : 增量备份 inotify: 实时通知 理论 一、rsync 与传统的 cp、tar 备份方式相比,rsync 具有安全性高、备份迅速、支持增量

Jenkins, Q&A

1、镜像选择 jenkinsci/blueocean , why? 安装blue ocean插件前 安装blue ocean插件后 2、启动参数都表示什么? 1 2 3 4 5 6 7 8 docker run \ --rm \ -u root \ -p 8080:8080 \ -v jenkins-data:/var/jenkins_home

Jenkins, how to play?

how to play jenkins? 社区源码、文档1等托管在 GitHub 上。 其中基础设施部分在 jenkins-infra; 核心库以及插件在 jenkinsci2; Jenkins 中文本地化相关的

Introduction to the Go compiler cmd/compile contains the main packages that form the Go compiler. The compiler may be logically split in four phases, which we will briefly describe alongside the list of packages that contain their code. You may sometimes hear the terms “front-end” and “back-end” when referring to the compiler. Roughly speaking, these translate to the first two and last two phases we are going to list here.

parse cmd/compile/internal/syntax (lexer, parser, syntax tree) 一、lexer、parse token化 1 2 3 4 5 6 7 8 9 type token uint //go:generate stringer -type token -linecomment tokens.go const ( _ token = iota _EOF ... ) 其中有一句: 1 2 // Make sure we have at most 64 tokens so