generated from d3ta-go/project-template
/
banner.go
43 lines (36 loc) · 1.27 KB
/
banner.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package echo
import (
"github.com/labstack/echo/v4"
color "github.com/labstack/gommon/color"
"github.com/d3ta-go/system/system/config"
)
const (
// https://www.ascii-art-generator.org/ ( lean )
myBanner = `
Welcome to:
_/_/_/ _/_/_/ _/_/_/_/_/ _/_/
_/ _/ _/ _/ _/ _/ _/_/_/ _/_/
_/ _/ _/_/ _/ _/_/_/_/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/_/_/ _/_/_/ _/ _/ _/ _/_/_/ _/_/
_/
_/_/ %s
High performance, minimalist d3ta-go web framework
Based on Echo %s (https://echo.labstack.com/)
%s
%s
___________________________________________O/____________
O\
`
)
// printSvrHeader print server header - banner
func printSvrHeader(e *echo.Echo, cfg *config.Config) {
colorer := color.New()
colorer.SetOutput(e.Logger.Output())
colorer.Printf(myBanner,
colorer.Cyan("v"+cfg.Applications.Servers.RestAPI.Version),
colorer.Red("v"+echo.Version),
colorer.Cyan(cfg.Applications.Servers.RestAPI.Name),
colorer.Yellow(cfg.Applications.Servers.RestAPI.Description),
)
}