代码拉取完成,页面将自动刷新
// Copyright 2021 eatmoreapple. All rights reserved.
// Use of this source code is governed by a GPL style
// license that can be found in the LICENSE file.
package regia
import (
"fmt"
"github.com/eatmoreapple/regia/internal"
)
var Banner = `
██████╗ ███████╗ ██████╗ ██╗ █████╗
██╔══██╗██╔════╝██╔════╝ ██║██╔══██╗
██████╔╝█████╗ ██║ ███╗██║███████║
██╔══██╗██╔══╝ ██║ ██║██║██╔══██║
██║ ██║███████╗╚██████╔╝██║██║ ██║
╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝╚═╝ ╚═╝
`
const _regia = "[REGIA]"
// Starter will be called while engine is running
type Starter interface {
Start(engine *Engine) error
}
type BannerStarter struct{ Banner string }
func (b BannerStarter) Start(engine *Engine) error {
fmt.Println(b.Banner)
return nil
}
type UrlInfoStarter struct{}
func (u UrlInfoStarter) Start(engine *Engine) error {
for method, nodes := range engine.methodsTree {
m := internal.FormatColor(97, method)
for _, n := range nodes {
handleCount := internal.BlueString(fmt.Sprintf("%d handlers", len(n.group)))
path := internal.YellowString(n.path)
fmt.Printf("%-15s %-18s %-18s %s\n", _regia, m, handleCount, path)
}
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。