Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GenerateLogger hclog.Logger = logger.HcLog().Named("generate")
Functions ¶
Types ¶
type Flags ¶
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 ¶
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 ¶
The `BindRouteOnly` function is used to bind the `RoutesOnly` flag to a command in the Cobra library.
func (*Flags) BindRpcOnly ¶
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.