cli

package
v1.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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) Binary

func (gs *CliSample) Binary() string

Binary returns the binary used when creating the sample

func (*CliSample) CommandContext

func (gs *CliSample) CommandContext() command.CommandContext

CommandContext returns the CommandContext that the CliSample is using

func (*CliSample) Dir

func (gs *CliSample) Dir() string

Dir returns the directory the sample is created in

func (*CliSample) Domain

func (gs *CliSample) Domain() string

Domain returns the domain of the CliSample

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

func (gs *CliSample) GenerateApi() error

GenerateApi runs the `create api` subcommand of the binary provided

func (*CliSample) GenerateInit

func (gs *CliSample) GenerateInit() error

GenerateInit runs the `init` subcommand of the binary provided

func (*CliSample) GenerateWebhook

func (gs *CliSample) GenerateWebhook() error

GenerateWebhook runs the `create webhook` subcommand of the binary provided

func (*CliSample) Name

func (gs *CliSample) Name() string

Name returns the name of the CliSample

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL