FILE / ScuroNeko/mtg

main.go

Исходный файл и его история в репозитории.
FILE 4c75066ef84b8c7f989a57645a35d7768d079a92
Files
mtg/main.go
T
2021-04-09 14:51:46 +03:00

36 lines
821 B
Go

// mtg is just a command-line application that starts a proxy.
//
// Application logic is how to read a config and configure mtglib.Proxy.
// So, probably you need to read the documentation for mtglib package
// first.
//
// mtglib is a core of the application. The rest of the packages provide
// some default implementations for the interfaces, defined in mtglib.
package main
import (
"math/rand"
"time"
"github.com/9seconds/mtg/v2/internal/cli"
"github.com/9seconds/mtg/v2/internal/utils"
"github.com/alecthomas/kong"
)
var version = "dev" // has to be set by ldflags
func main() {
rand.Seed(time.Now().UTC().UnixNano())
if err := utils.SetLimits(); err != nil {
panic(err)
}
cli := &cli.CLI{}
ctx := kong.Parse(cli, kong.Vars{
"version": version,
})
ctx.FatalIfErrorf(ctx.Run(cli, version))
}