cmd

package
v0.0.0-...-a4a0adb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Main is the main command.
	Main = gcmd.Command{
		Name:  "main",
		Usage: "main",
		Brief: "start http server",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
			conf := config.NewDefaultConfiguration([]string{"192.168.110.30:8091"})
			conf.Consumer.LocalCache.SetPersistDir("./manifest/logs/polaris/backup")
			if err := api.SetLoggersDir("./manifest/logs/polaris/log"); err != nil {
				g.Log().Fatal(context.Background(), err)
			}
			grpcx.Resolver.Register(polaris.NewWithConfig(conf, polaris.WithTTL(10)))

			c := grpcx.Server.NewConfig()
			c.Options = append(c.Options, []grpc.ServerOption{
				grpcx.Server.ChainUnary(
					grpcx.Server.UnaryValidate,
				)}...,
			)
			s := grpcx.Server.New(c)
			user.Register(s)
			s.Run()
			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