grpc

package
v0.0.0-...-16a7155 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdGrpc = &cobra.Command{
	Use: "grpc",

	Short: "Init a gRPC components",
	Long:  `Init a gRPC components`,

	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := context.Background()

		initor, err := gen.NewInitor(grpc.Config{})
		if err != nil {
			return fmt.Errorf("boiler: failed to create initor: %w", err)
		}
		if err = initor.Init(ctx); err != nil {
			return fmt.Errorf("boiler: initor failed: %w", err)
		}
		log.Infof("boiler: grpc components initialized")

		return nil
	},

	PreRunE: func(cmd *cobra.Command, args []string) error {
		ctx := context.Background()

		initor, err := gen.NewInitor(project.Config{
			GoModName:       flagGoModName,
			GoModVersion:    flagGoModVersion,
			ProjectDescPath: flagProjectConfigPath,
		})
		if err != nil {
			return fmt.Errorf("boiler: failed to create initor: %w", err)
		}
		if err = initor.Init(ctx); err != nil {
			return fmt.Errorf("boiler: initor failed: %w", err)
		}
		log.Infof("boiler: project components initialized")

		return nil
	},

	PostRunE: func(cmd *cobra.Command, args []string) error {
		return execMakeGrpcBinDeps()
	},
}

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