本文整理汇总了Golang中github.com/Sean-Der/fail2go.Conn.JailFindTime方法的典型用法代码示例。如果您正苦于以下问题:Golang Conn.JailFindTime方法的具体用法?Golang Conn.JailFindTime怎么用?Golang Conn.JailFindTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/Sean-Der/fail2go.Conn
的用法示例。
在下文中一共展示了Conn.JailFindTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: jailGetHandler
func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fail2go.Conn) {
currentlyFailed, totalFailed, fileList, currentlyBanned, totalBanned, IPList, err := fail2goConn.JailStatus(mux.Vars(req)["jail"])
if err != nil {
writeHTTPError(res, err)
return
}
failRegexes, _ := fail2goConn.JailFailRegex(mux.Vars(req)["jail"])
findTime, _ := fail2goConn.JailFindTime(mux.Vars(req)["jail"])
useDNS, _ := fail2goConn.JailUseDNS(mux.Vars(req)["jail"])
maxRetry, _ := fail2goConn.JailMaxRetry(mux.Vars(req)["jail"])
if IPList == nil {
IPList = []string{}
}
if failRegexes == nil {
failRegexes = []string{}
}
encodedOutput, _ := json.Marshal(map[string]interface{}{
"currentlyFailed": currentlyFailed,
"totalFailed": totalFailed,
"fileList": fileList,
"currentlyBanned": currentlyBanned,
"totalBanned": totalBanned,
"IPList": IPList,
"failRegexes": failRegexes,
"findTime": findTime,
"useDNS": useDNS,
"maxRetry": maxRetry})
res.Write(encodedOutput)
}