Documentation
¶
Index ¶
- type CliSample
- func (gs *CliSample) Binary() string
- func (gs *CliSample) CommandContext() command.CommandContext
- func (gs *CliSample) Dir() string
- func (gs *CliSample) Domain() string
- func (gs *CliSample) GVKs() []schema.GroupVersionKind
- func (gs *CliSample) GenerateApi() error
- func (gs *CliSample) GenerateInit() error
- func (gs *CliSample) GenerateWebhook() error
- func (gs *CliSample) Name() string
- type CliSampleOption
- func WithCLI(c *cli.CLI) CliSampleOption
- func WithCommandContext(commandContext command.CommandContext) CliSampleOption
- func WithDomain(domain string) CliSampleOption
- func WithExtraApiOptions(options ...string) CliSampleOption
- func WithExtraInitOptions(options ...string) CliSampleOption
- func WithExtraWebhookOptions(options ...string) CliSampleOption
- func WithGvk(gvks ...schema.GroupVersionKind) CliSampleOption
- func WithName(name string) CliSampleOption
- func WithPlugins(plugins ...string) CliSampleOption
- func WithRepository(repo string) CliSampleOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CliSample ¶
type CliSample struct {
// contains filtered or unexported fields
}
CliSample is a generalized object that implements the Sample interface. It is meant to be as simple and versatile to make the process of generating test samples easier TODO: Consider making it easier to create custom cli flags on a per GVK basis for the `create api` and `create webhook` subcommands
func NewCliSample ¶
func NewCliSample(opts ...CliSampleOption) (*CliSample, error)
NewCliSample will return a new CliSample object. The values used in the CliSample can be modified using CliSampleOption functions
func (*CliSample) CommandContext ¶
func (gs *CliSample) CommandContext() command.CommandContext
CommandContext returns the CommandContext that the CliSample is using
func (*CliSample) GVKs ¶
func (gs *CliSample) GVKs() []schema.GroupVersionKind
GVKs returns the list of GVKs that is used for creating apis and webhooks
func (*CliSample) GenerateApi ¶
GenerateApi runs the `create api` subcommand of the binary provided
func (*CliSample) GenerateInit ¶
GenerateInit runs the `init` subcommand of the binary provided
func (*CliSample) GenerateWebhook ¶
GenerateWebhook runs the `create webhook` subcommand of the binary provided
type CliSampleOption ¶
type CliSampleOption func(gs *CliSample)
CliSampleOption is a function that modifies the values in a CliSample to be used when creating a new CliSample
func WithCLI ¶
func WithCLI(c *cli.CLI) CliSampleOption
WithCLI sets the CLI tool that this sample should use for generation
func WithCommandContext ¶
func WithCommandContext(commandContext command.CommandContext) CliSampleOption
WithCommandContext sets the CommandContext that is used to execute scaffold commands
func WithDomain ¶
func WithDomain(domain string) CliSampleOption
WithDomain sets the domain to be used during scaffold execution
func WithExtraApiOptions ¶
func WithExtraApiOptions(options ...string) CliSampleOption
WithExtraApiOptions sets any additional options that should be passed into a create api subcommand
func WithExtraInitOptions ¶
func WithExtraInitOptions(options ...string) CliSampleOption
WithExtraInitOptions sets any additional options that should be passed into an init subcommand
func WithExtraWebhookOptions ¶
func WithExtraWebhookOptions(options ...string) CliSampleOption
WithExtraWebhookOptions sets any additional options that should be passed into a create webhook subcommand
func WithGvk ¶
func WithGvk(gvks ...schema.GroupVersionKind) CliSampleOption
WithGvk sets the GroupVersionKind to be used during scaffold execution
func WithName ¶
func WithName(name string) CliSampleOption
WithName sets the name of the sample that is scaffolded
func WithPlugins ¶
func WithPlugins(plugins ...string) CliSampleOption
WithPlugins sets the plugins that should be used during scaffolding
func WithRepository ¶
func WithRepository(repo string) CliSampleOption
WithRepository sets the repository to be used during scaffold execution