generate

package
v1.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenerateLogger hclog.Logger = logger.HcLog().Named("generate")

Functions

func PreRun

func PreRun(projectPath string) error

func Run

func Run(flags *Flags, config *raiden.Config, projectPath string, initialize bool) error

The `Run` function generates code based on the provided flags and configuration, including generating controllers, routes, and a main function.

Types

type Flags

type Flags struct {
	RpcOnly    bool
	RoutesOnly bool
	InitMode   bool
}

The above type represents a set of flags used for configuring different modes in a Go program. @property {bool} RpcOnly - RpcOnly is a boolean flag that indicates whether the program should only run in RPC mode. @property {bool} RoutesOnly - RoutesOnly is a boolean flag that indicates whether only the routes should be processed. @property {bool} InitMode - The `InitMode` property is a boolean flag that indicates whether the program should run in initialization mode.

func (*Flags) Bind

func (f *Flags) Bind(cmd *cobra.Command)

The `Bind` function is used to bind the flags of the `Flags` struct to a command in the Cobra library. It takes a `cmd` parameter, which is a command in the Cobra library, and calls the `BindRouteOnly` and `BindRpcOnly` functions to bind the corresponding flags to the command.

func (*Flags) BindRouteOnly

func (f *Flags) BindRouteOnly(cmd *cobra.Command)

The `BindRouteOnly` function is used to bind the `RoutesOnly` flag to a command in the Cobra library.

func (*Flags) BindRpcOnly

func (f *Flags) BindRpcOnly(cmd *cobra.Command)

The `BindRpcOnly` function is used to bind the `RpcOnly` flag to a command in the Cobra library. It checks if the command already has a flag named "rpc-only" and if so, it binds the `RpcOnly` flag to that flag. If the command does not have a flag named "rpc-only", it creates a new flag with the name "rpc-only" and binds the `RpcOnly` flag to it. The function also sets the default value and usage message for the flag.

func (*Flags) IsGenerateAll

func (f *Flags) IsGenerateAll() bool

Jump to

Keyboard shortcuts

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