cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name    = "trainer"     // Name is the name of the compiled software.
	Version string          // Version is the version of the compiled software.
	ID, _   = os.Hostname() // 主机信息

)

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

View Source
var (
	CronTrainer = &gcmd.Command{
		Name:        "cron-trainer",
		Brief:       "start trainer cron task",
		Description: "entry to start a trainer cron task",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {

			return nil
		},
	}
)
View Source
var (
	JobTrainer = &gcmd.Command{
		Name:        "job-trainer",
		Brief:       "start trainer job",
		Description: "entry to start a trainer job",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {

			return nil
		},
	}
)
View Source
var (
	Main = gcmd.Command{
		Name:  "main",
		Usage: "main <sub-command>",
		Brief: "this is main command, please specify a sub command",
	}
)
View Source
var (
	Service = &gcmd.Command{
		Name:        "svc",
		Brief:       "start trainer grpc service",
		Description: "entry to start a trainer grpc service",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
			app, cleanup, err := wireApp(
				ctx,
				svcInfo,
				pubCfg.Discovery,
				pubCfg.Log,
				pubCfg.Adapter,
				pubCfg.Trace,
				srvCfg.Grpc,
				srvCfg.Register,
			)
			if err != nil {
				panic(err)
			}
			defer cleanup()

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

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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