小编bat*_*zor的帖子

kubernetes如何设置日志文件的最大大小?

如何设置日志文件的最大大小?或启用日志轮换.在文档中我没有找到任何关于此的内容.

或者有必要为此编写脚本?

logging rotation docker coreos kubernetes

10
推荐指数
1
解决办法
3583
查看次数

Kubernetes.HTTPS API返回"未授权"

Kubernetes API请求curl https://192.168.0.139 --cacert /home/mongeo/ku-certs/ca.pem返回Unauthorized

请求curl localhost:8080工作得很好.

我的kube-proxy和kube-apiserver standart(coreos + k8s教程)

如何获取HTTPS数据?

curl docker kubernetes tls1.2

6
推荐指数
1
解决办法
1万
查看次数

泊坞窗.npm install - >错误:getaddrinfo ENOTFOUND

为什么我无法在Docker中收到包node.js. 我收到以下消息:

Step 10 : RUN npm install
 ---> Running in 20f3e58dea20
npm info it worked if it ends with ok
npm info using npm@2.14.7
npm info using node@v4.2.3
npm http request GET https://registry.npmjs.org/amqp
npm info attempt registry request try #2 at 3:40:26 PM
npm http request GET https://registry.npmjs.org/mongodb
npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm info retry …
Run Code Online (Sandbox Code Playgroud)

dns node.js npm docker

5
推荐指数
1
解决办法
2197
查看次数

如何在 golangci-lint 中跳过文件?

我尝试go1.16

import "embed"
Run Code Online (Sandbox Code Playgroud)

我明白了

> golangci-lint run ./...
> Can't run linter goanalysis_metalinter: bodyclose: failed prerequisites ... could not import embed
Run Code Online (Sandbox Code Playgroud)

如何在 golangci-lint 中跳过文件/包?

go golint

5
推荐指数
1
解决办法
1万
查看次数

如何在 HTTP 中间件处理程序之间重用 *http.Request 的请求正文?

我使用 go-chi 作为 HTTP 路由器,我想在另一种方法中重用一种方法

func Registration(w http.ResponseWriter, r *http.Request) {
    b, err := ioutil.ReadAll(r.Body) // if you delete this line, the user will be created   
    // ...other code

    // if all good then create new user
    user.Create(w, r)
}

...

func Create(w http.ResponseWriter, r *http.Request) {
  b, err := ioutil.ReadAll(r.Body)  
  // ...other code

  // ... there I get the problem with parse JSON from &b
}
Run Code Online (Sandbox Code Playgroud)

user.Create 返回错误 "unexpected end of JSON input"

其实,在我执行的ioutil.ReadAll
user.Create停止解析JSON,
r.Body …

middleware http go

3
推荐指数
2
解决办法
1824
查看次数

特定路由上的中间件

在 中go-chi,在单个路由级别设置中间件,而不仅仅是针对所有路由全局设置

// Routes creates a REST router
func Routes() chi.Router {
    r := chi.NewRouter()
    r.Use(middleware.Captcha)

    r.Post("/", Login)

    return r
}
Run Code Online (Sandbox Code Playgroud)

如何Login指定唯一的中间件或从通用中间件中排除?

middleware http go go-chi

3
推荐指数
1
解决办法
2976
查看次数

如何在 node-amqp 中使用 x-message-ttl?

如何设置x-message-ttl队列RabbitMQ?我使用 node-amqp 包。

connection.queue('echo', {autoDelete: false, durable: true, "x-message-ttl":20000});

amqp ttl rabbitmq node.js

2
推荐指数
1
解决办法
2656
查看次数

如何在grpc-gateway中设置超时?

如何在grpc-gateway中设置超时?
我想限制请求执行的时间,在哪里可以设置时间限制?我需要为此创建一个“拦截器”吗?

go grpc grpc-gateway

2
推荐指数
1
解决办法
3137
查看次数

标签 统计

go ×4

docker ×3

http ×2

kubernetes ×2

middleware ×2

node.js ×2

amqp ×1

coreos ×1

curl ×1

dns ×1

go-chi ×1

golint ×1

grpc ×1

grpc-gateway ×1

logging ×1

npm ×1

rabbitmq ×1

rotation ×1

tls1.2 ×1

ttl ×1