2 Star 0 Fork 0

mirrors_jedisct1/fastlike

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
backend.go 562 Bytes
一键复制 编辑 原始数据 按行查看 历史
package fastlike
import (
"fmt"
"net/http"
)
// BackendHandler is a function that takes a backend name and returns an http.Handler that can
// satisfy that backend
type BackendHandler func(backend string) http.Handler
func defaultBackendHandler() BackendHandler {
return func(backend string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadGateway)
var msg = fmt.Sprintf(`Unknown backend '%s'. Did you configure your backends correctly?`, backend)
w.Write([]byte(msg))
})
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_jedisct1/fastlike.git
git@gitee.com:mirrors_jedisct1/fastlike.git
mirrors_jedisct1
fastlike
fastlike
master

搜索帮助