Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Version is the build version eg: v1.0.0 Version string // MinVersion is the latest commit hash on building MinVersion string // BuildTime is the unix timestamp when the build was done BuildTime string )
Functions ¶
This section is empty.
Types ¶
type CodeGenerator ¶
type CodeGenerator struct { *CommandWriter fs.FS // contains filtered or unexported fields }
CodeGenerator will act as a base class for all code generator commands
func NewCodeGenerator ¶
func NewCodeGenerator(writer *CommandWriter) *CodeGenerator
NewCodeGenerator return a new instance of CodeGenerator
func (*CodeGenerator) GetDefenitionsAndTypes ¶
func (c *CodeGenerator) GetDefenitionsAndTypes() (*parser.Definition, *types.TypeDefs, error)
GetDefenitionsAndTypes will parse given config and return definitions and typedefs
func (*CodeGenerator) InitFlags ¶
func (c *CodeGenerator) InitFlags()
InitFlags will initialize all flags
func (*CodeGenerator) ParseFlags ¶
func (c *CodeGenerator) ParseFlags(args []string)
ParseFlags will parse given flags
func (*CodeGenerator) Setup ¶
func (c *CodeGenerator) Setup() bool
Setup will setup log levels and help command
type CommandWriter ¶
type CommandWriter struct {
// contains filtered or unexported fields
}
CommandWriter can be used to write help texts to stdout/tcp or any given writer interface
func NewCommandWriter ¶
func NewCommandWriter(writer io.Writer) *CommandWriter
NewCommandWriter returns an instance of CommandWriter
func (*CommandWriter) Write ¶
func (c *CommandWriter) Write(msg ...string) error
Write writes given string to the registered writer interface
type Relay ¶
type Relay struct {
*CodeGenerator
}
Relay is the command doing code generation
type Server ¶
type Server struct {
*CodeGenerator
}
Server is the command doing code generation
func NewServer ¶
func NewServer(writer *CommandWriter) *Server
NewServer return a new instance of Server
type VersionCmd ¶
type VersionCmd struct {
*CommandWriter
}
VersionCmd is the VersionCmd command
func NewVersionCmd ¶
func NewVersionCmd(writer *CommandWriter) *VersionCmd
NewVersionCmd returns a new instalce of VersionCmd
func (VersionCmd) Exec ¶
func (v VersionCmd) Exec() error
Exec will print the build versionCmd details
func (VersionCmd) Help ¶
func (v VersionCmd) Help()
Help prints VersionCmd text for the command, not needed here
func (VersionCmd) ParseFlags ¶
func (VersionCmd) ParseFlags(args []string)
ParseFlags will parse given flags