会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
qcy-blog
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
49
下一页
2024年11月14日
Go使用big-cache
摘要: package main import ( "fmt" "time" "github.com/allegro/bigcache/v3" ) func main() { config := bigcache.Config{ // 分片数量 必须为2的整数次幂 Shards: 1024, // 条目可以
阅读全文
posted @ 2024-11-14 17:49 朝阳1
阅读(88)
评论(0)
推荐(0)
2024年11月13日
Fastapi使用redis
摘要: 异步版本 rediss.py from fastapi import FastAPI, Depends,APIRouter import redis.asyncio as aioredis import uvicorn from contextlib import asynccontextmanag
阅读全文
posted @ 2024-11-13 15:41 朝阳1
阅读(452)
评论(0)
推荐(0)
分享一个select+定时器的一个代码
摘要: 问题1:下面代码输出什么 package main import ( "fmt" "time" ) func main() { // 创建两个定时器,一个间隔为1秒,另一个间隔为2秒 ticker1 := time.NewTicker(1 * time.Second) ticker2 := time
阅读全文
posted @ 2024-11-13 13:55 朝阳1
阅读(28)
评论(0)
推荐(0)
2024年11月12日
python读取配置文件的几种方式
摘要: 下面只演示toml格式的,其他方式的就配置文件不一样 conf.toml [database] dbtype = "mysql" [database.mysql] host = "127.0.0.1" port = 3306 user = "root" password = "123456" dbn
阅读全文
posted @ 2024-11-12 14:35 朝阳1
阅读(164)
评论(0)
推荐(0)
python使用loguru入门
摘要: 自定义json格式 from loguru import logger import json from datetime import datetime import inspect # 定义一个函数来创建 JSON 格式的日志 def json_log(level, message, **kwa
阅读全文
posted @ 2024-11-12 11:58 朝阳1
阅读(119)
评论(0)
推荐(0)
express使用morgan+file-stream-rotator实现自定义日志+轮转
摘要: import express, {json} from 'express'; import fs from 'fs'; import path from 'path'; import morgan from 'morgan'; import FileStreamRotator from 'file-
阅读全文
posted @ 2024-11-12 10:57 朝阳1
阅读(54)
评论(0)
推荐(0)
2024年11月8日
thiserror
摘要: toml thiserror = "2.0" rs use std::io::Read; use std::{fs,io}; use thiserror::Error; #[derive(Debug,Error)] enum MyError{ #[error("")] IoError(#[from]
阅读全文
posted @ 2024-11-08 16:52 朝阳1
阅读(19)
评论(0)
推荐(0)
ab压测
摘要: 一般的服务器都会自带apache服务器,不需要单独安装 sudo apt-get install apache2-utils sudo yum install httpd-tools ab的命令参数比较多,但是最常用的就3个 ab -c 10000 -n 100000 http://www.baid
阅读全文
posted @ 2024-11-08 09:24 朝阳1
阅读(24)
评论(0)
推荐(0)
2024年11月7日
Go使用nacos配置中心
摘要: 不使用注册中心的话,可以使用viper,时时监控配置文件的变化,有变化就更新 nacos安装可以参考官网选择二进制或者docker https://nacos.io/download/nacos-server/ go package main import ( "fmt" "github.com/n
阅读全文
posted @ 2024-11-07 10:32 朝阳1
阅读(161)
评论(0)
推荐(0)
2024年11月6日
log4rs使用配置文件
摘要: yaml # 检查配置文件变动的时间间隔 refresh_rate: 10 seconds # appender 负责将日志收集到控制台或文件, 可配置多个 appenders: stdout: # 控制台输出 kind: console encoder: # 格式可配置,具体格式详见: # htt
阅读全文
posted @ 2024-11-06 09:58 朝阳1
阅读(205)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
49
下一页
公告