Documentation ¶
Index ¶
Constants ¶
View Source
const ConfigTemplate = `` /* 474-byte string literal not displayed */
View Source
const HookTemplate = `` /* 541-byte string literal not displayed */
View Source
const MainTemplate = `` /* 772-byte string literal not displayed */
Variables ¶
View Source
var Command = &cobra.Command{
Use: "plugin",
Short: "code generator",
Example: "The following command will generate a code template for the 'awesome' plugin, which makes use of OnBasicAuth and OnSubscribe hook and enables the configuration in ./plugin directory.\n" +
"\n" +
"gmqctl gen plugin -n awesome -H OnBasicAuth,OnSubscribe -c true -o ./plugin",
}
Functions ¶
func ValidateHookName ¶
ValidateHookName returns an error when the given hook name is invalid
func ValidateHooks ¶
ValidateHooks parse the input string into hook name slice. Return an error when any of the names is invalid.
Types ¶
type Var ¶
type Var struct { // Name is the plugin name. Snack style. Name string // StrutName is the struct name. Camel style. StrutName string // Receiver is the struct method receiver. Receiver string // Hooks is the hooks used in the plugin. Hooks []string // Config indicates whether the plugin use configuration. Config bool }
Var is the template variable for all templates
Click to show internal directories.
Click to hide internal directories.