HLD 和 LLD 的区别

High Level Design  (HLD) 概要设计说明是指系统的总体设计。它是对应用程序的总体描述。包括系统架构设计、数据库设计、系统、服务、平台及模块间关系的简要描述。它也被称为宏级/系统设计。它是由解决方案架构师创建的。它将业务/客户端需求转换为高级解决方案。它是在详细设计说明(LLD)之前建立的。 Low Level Design (LLD) 简单地说,详细设计说明就像详细的HLD意味着它指的是组件级设计过程。它对每个模块进行了详细的描述,意味着它包含了每个系统组件的实际逻辑,并深入到每个模块的规范中。这也被称为微观层次/详细设计。它是由设计师和开发人员创建的。它将概要解决方案转换为详细解决方案。它是概要设计说明之后创建。 HLD LLD HLD是指系统的总体设计。 LLD就像细化HLD意味着它指的是组件级设计过程。 High Level Design in short called as HLD. Low Level Design in short called as LLD. …

从私有仓库拉取镜像

参考文献: https://kubernetes.io/zh/docs/tasks/configure-pod-container/pull-image-private-registry/ 在集群中创建保存授权令牌的 Secret Create Secret kubectl create secret docker-registry yyy-regcred \ –docker-server=registry.cn-hangzhou.aliyuncs.com \ –docker-username=****@aliyun.com \ –docker-password=**** \ –docker-email=****@aliyun.com ## output -> secret/yyy-regcred created 获取凭证 kubectl get secret yyy-regcred –output="jsonpath={.data.\.dockerconfigjson}" …

Nested JSON Validation in Laravel / Lumen

我们可能会提交这样一个请求,一个 嵌套的 JSON 对象,那么如何对 JSON 对象的那边元素进行验证呢? ### Save Post Comments POST {{API_BASE_URL}}/module/v1/posts/2/comments Content-Type: application/json Accept: application/json Authorization: Bearer {{TOKEN}} { "data": [ { "media_ids": [1,2,3], "title": "Title A", "status": "A", …

阿里云测试 MicroK8s 笔记

资料收集: https://stackoverflow.com/questions/63974879/microk8s-metallb-ingress-nginx-how-to-route-external-traffic https://pacroy.medium.com/single-node-kubernetes-on-home-lab-using-microk8s-metallb-and-traefik-7bb1ea38fcc2 SSL: https://stackoverflow.com/questions/67430592/how-to-setup-letsencrypt-with-kubernetes-microk8s-using-default-ingress 验证: 2021-06-24 kubectl remote control get config microk8s kubectl config view –raw > $HOME/.kube/config save the config file to local $HOME/.kube/config 设置端口转发 ## minikube is …

A simple API Gateway in Lumen

如何使用 Lumen 开发一个简单的 API Gateway Routes create a file called gateway.php in config folder. Register gateway to lumen routes. Edit AppServiceProvider.php in app/Providers/ folder. Controller AppServiceProvider will send all request …

PHP 冒泡算法

没什么用,写了玩玩的。 function bubble_sort(array $items): array { for ($i = 0; $i < count($items); $i++) { for ($j = $i + 1; $j < count($items); $j++) { if ($items[$i] > $items[$j]) …

Laravel/Lumen Customizing Monolog For Channels

官方文档 https://laravel.com/docs/6.x/logging#creating-monolog-handler-channels 首先 新建一个 文件: 如官方文档所示,可以在 __invoke 方法里定制你的 logger,例如你想要 json 格式的日志的话: 更多设置: 输出的日志样本如下: { “message”: “Undefind method: \”asdasdad\””, “context”: {}, “level”: 400, “level_name”: “ERROR”, “channel”: “local”, “datetime”: “2020-05-11T17:05:07.231673+08:00”, “extra”: { …

Multiple middleware parameters in Lumen

Add route middleware in bootstrap/app.php To middleware to routes within a group, Use “,” separate roles, don’t use “|” as separater, the tutorial from here https://docs.spatie.be/laravel-permission/v3/basic-usage/middleware/ is for Laravel only …

HTTP Public Key Pinning 公钥固定介绍

文件名 内容 chain.pem 浏览器需要的所有证书但不包括服务端证书,比如根证书和中间证书 fullchain.pem 包括了cert.pem和chain.pem的内容 privkey.pem 证书的私钥 cert1.pem或cert.pem 服务端证书 添加以下行并插入适当的 pin-sha256 =“…”的值将在您的nginx上启用HPKP

递归 (JavaScript && PHP)

编程语言中,函数Func(Type a,……)直接或间接调用函数本身,则该函数称为递归函数。递归函数不能定义为内联函数。

Nginx fastcgi_cache And proxy_cache

FastCGI Cache Example FastCGI Cache VS WP Super Cache FastCGI cache is faster than WP Super Cache because the latter uses .htaccess and PHP itself to route the visitor to …

PHP 模拟 RSA 算法

从 1-10 中间任意取两个 质素 p 和 q 让 p*q = n funN = (p-1) * (q-1) 获取 公钥 e: – 1 < e < funN– e 和 funN 互质 获取 …

JWT authentication for Lumen

参考:https://medium.com/tech-tajawal/jwt-authentication-for-lumen-5-6-2376fd38d454 1.Add JWT_SECRET=xxxx to yours.env file 2. Create a migration file for the users table: 3. Modify the migration file created inside the database/migrations directory 4. create the seeder to populate the …

使用 Intervention Image (PHP Package)修改图片大小

Intervention Image 是一个PHP图像处理和操作库,提供了一种更简单、更富表现力的方法来创建、编辑和组合图像。该包包括 ServiceProviders  和 Facades,便于Laravel集成。 这儿只是描述使用这个包来做一些最常用的图片截取调整大小的操作。 安装 例子 关于 调整大小 fit – 裁剪和调整大小相结合 resize – 调整大小