cmd

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name is the name of the compiled software.
	Name string
	// Version is the version of the compiled software.
	Version string
)

go build -ldflags "-X main.Version=x.y.z"

View Source
var ServerCmd = &cobra.Command{
	Use:   "server",
	Short: "start the server",
	Run: func(cmd *cobra.Command, args []string) {
		c := config.New(
			config.WithSource(
				file.NewSource(flagconf),
			),
		)
		defer c.Close()

		if err := c.Load(); err != nil {
			panic(err)
		}

		var bc conf.Bootstrap
		if err := c.Scan(&bc); err != nil {
			panic(err)
		}

		log := logger.NewLogger(bc.Logger)
		app, cleanup, err := wireApp(bc.Server, bc.Biz, bc.Data, log)
		if err != nil {
			panic(err)
		}
		defer cleanup()

		if err := app.Run(); err != nil {
			panic(err)
		}
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL