上一页 1 2 3 4 5 6 7 8 ··· 49 下一页
摘要: ws或者tcp不像http有路由,只能自定义消息格式,拆出来路由 message package message import ( "encoding/json" "github.com/olahol/melody" ) // Message 消息结构体 type Message struct { 阅读全文
posted @ 2025-08-12 14:23 朝阳1 阅读(9) 评论(0) 推荐(0)
摘要: ![image](https://img2024.cnblogs.com/blog/3302358/202508/3302358-20250804163050222-2001887912.png) 阅读全文
posted @ 2025-08-04 16:30 朝阳1 阅读(4) 评论(0) 推荐(0)
摘要: *args和**kwargs: *args接收可变数量的位置参数(元组) **kwargs接收可变数量的关键字参数(字典) grep查找a.txt文件中某字符,并打印该字符的位置.-n显示行号,-o仅输出匹配字符,-b显示字节偏移量 grep -nob '目标字符' a.txt is和==的区别: 阅读全文
posted @ 2025-08-04 14:41 朝阳1 阅读(12) 评论(0) 推荐(0)
摘要: package main import ( "crypto/tls" "fmt" "net" "sync" "time" ) type CertInfo struct { Domain string ExpiryTime time.Time DaysLeft int Error error } fu 阅读全文
posted @ 2025-07-18 16:48 朝阳1 阅读(11) 评论(0) 推荐(0)
摘要: 单机部署docker镜像的话可以用这种方式。比如几分钟运行一次脚本,高峰期可以处理一下 #!/bin/bash SERVICE=web # 你启动的docker ps后的名字 MAX_REPLICAS=5 MIN_REPLICAS=1 THRESHOLD=80 # 80% CPU # 获取所有 we 阅读全文
posted @ 2025-07-18 09:42 朝阳1 阅读(11) 评论(0) 推荐(0)
摘要: version: '3.8'# 指定Compose文件的版本 services: # 定义多个服务 web: # Web服务,通常是前端或后端的应用 image: nginx:latest # 使用Nginx镜像 ports: - "80:80"# 将容器的80端口映射到主机的80端口 volume 阅读全文
posted @ 2025-07-18 09:34 朝阳1 阅读(34) 评论(0) 推荐(0)
摘要: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apac 阅读全文
posted @ 2025-07-16 13:53 朝阳1 阅读(25) 评论(0) 推荐(0)
摘要: Pod里是容器,Pod被ReplicaSet管理,ReplicaSet控制pod的数量;ReplicaSet被Deployment管理,Deployment控制pod应用的升级、回滚,当然也能控制pod的数量。Service提供一个统一固定入口,负责将前端请求转发给Pod。 Deployment.y 阅读全文
posted @ 2025-07-15 10:31 朝阳1 阅读(34) 评论(0) 推荐(0)
摘要: 安装 pip install locust 测试脚本 locustfile.py from locust import TaskSet,HttpUser,task # 定义一个类 class WebsitUser(HttpUser): # 设置一个随机时间间隔 wait_time = between 阅读全文
posted @ 2025-07-14 17:50 朝阳1 阅读(18) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2025-07-12 13:58 朝阳1 阅读(2) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 49 下一页