mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
52 lines
1.7 KiB
Go
52 lines
1.7 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"strconv"
|
|
"strings"
|
|
|
|
"github.com/alice-lg/alice-lg/pkg/config"
|
|
"github.com/alice-lg/alice-lg/pkg/http"
|
|
"github.com/alice-lg/alice-lg/pkg/store"
|
|
)
|
|
|
|
var banner = []string{
|
|
" ** *** Alice ?VERSION ",
|
|
" ***** *** * ",
|
|
" * *** ** *** Listening on: ?LISTEN",
|
|
" *** ** * Routeservers: ?RSCOUNT",
|
|
" * ** ** ",
|
|
" * ** ** *** **** *** ",
|
|
" * ** ** *** * *** * * *** ",
|
|
" * ** ** ** * **** * *** ",
|
|
" * ** ** ** ** ** *** ",
|
|
" ********* ** ** ** ******** ",
|
|
" * ** ** ** ** ******* ",
|
|
" * ** ** ** ** ** ",
|
|
" ***** ** ** ** *** * **** * ",
|
|
" * **** ** * *** * *** * ******* ******* ",
|
|
"* ** ** *** *** ***** ***** ",
|
|
"* ",
|
|
" ** ",
|
|
}
|
|
|
|
func printBanner(
|
|
cfg *config.Config,
|
|
neighborsStore *store.NeighborsStore,
|
|
routesStore *store.RoutesStore,
|
|
) {
|
|
ctx := context.Background()
|
|
status, _ := http.CollectAppStatus(ctx, nil, routesStore, neighborsStore)
|
|
mapper := strings.NewReplacer(
|
|
"?VERSION", status.Version,
|
|
"?LISTEN", cfg.Server.Listen,
|
|
"?RSCOUNT", strconv.FormatInt(int64(len(cfg.Sources)), 10),
|
|
)
|
|
|
|
for _, l := range banner {
|
|
l = mapper.Replace(l)
|
|
fmt.Println(l)
|
|
}
|
|
}
|