Documentation
¶
Index ¶
- Constants
- func New(impl CLIHandlersInterface, version string) *urfavecli.Command
- type CLIHandlersInterface
- type Impl
- func (Impl) OcliGenerateCli(ctx context.Context, c *urfavecli.Command, flags OcliGenerateCliFlags) error
- func (Impl) OcliGenerateDocs(ctx context.Context, c *urfavecli.Command, flags OcliGenerateDocsFlags) error
- func (Impl) OcliSpecificationCheck(ctx context.Context, c *urfavecli.Command, args OcliSpecificationCheckArgs) error
- func (Impl) OcliSpecificationVersions(ctx context.Context, c *urfavecli.Command) error
- type OcliGenerateCliFlags
- type OcliGenerateDocsFlags
- type OcliSpecificationCheckArgs
Constants ¶
View Source
const ( ExitCodeOk = 0 ExitCodeInternalCliError = 1 ExitCodeBadUserInputError = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIHandlersInterface ¶
type CLIHandlersInterface interface {
// OcliGenerateCli handles the invocation of:
//
// “`sh
// ocli generate cli [flags]
// “`
OcliGenerateCli(ctx context.Context, cmd *urfavecli.Command, flags OcliGenerateCliFlags) error
// OcliGenerateDocs handles the invocation of:
//
// “`sh
// ocli generate docs [flags]
// “`
OcliGenerateDocs(ctx context.Context, cmd *urfavecli.Command, flags OcliGenerateDocsFlags) error
// OcliSpecificationCheck handles the invocation of:
//
// “`sh
// ocli specification check <path-to-spec>
// “`
OcliSpecificationCheck(ctx context.Context, cmd *urfavecli.Command, arguments OcliSpecificationCheckArgs) error
// OcliSpecificationVersions handles the invocation of:
//
// “`sh
// ocli specification versions
// “`
OcliSpecificationVersions(ctx context.Context, cmd *urfavecli.Command) error
}
CLIHandlersInterface represents the handlers required to implement all commands of the CLI. An implementation of this interface will be injected into the generated CLI wrapper code.
type Impl ¶
type Impl struct{}
func (Impl) OcliGenerateCli ¶
func (Impl) OcliGenerateDocs ¶
func (Impl) OcliSpecificationCheck ¶
type OcliGenerateCliFlags ¶
type OcliGenerateCliFlags struct {
SpecFile string
OutputDir string
Framework string
GoPackage string
ModuleType string
Dryrun bool
}
OcliGenerateCliFlags holds the parsed flags that will be injected into the command handler implementation.
type OcliGenerateDocsFlags ¶
OcliGenerateDocsFlags holds the parsed flags that will be injected into the command handler implementation.
type OcliSpecificationCheckArgs ¶
type OcliSpecificationCheckArgs struct {
PathToSpec string
}
OcliSpecificationCheckArgs holds the parsed arguments that will be injected into the command handler implementation.
Click to show internal directories.
Click to hide internal directories.