new

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoNameProvided = errors.New("the name for the new app is needed")

Functions

This section is empty.

Types

type AfterInitializer

type AfterInitializer interface {
	// AfterInitialize receives the context and the root folder where
	// the application is being initialized.
	AfterInitialize(context.Context, Options) error
}

AfterInitializer is intended to initialize applications, things that should happen at the end of the application creation process.

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command to generate New applications.

func (*Command) AppName

func (d *Command) AppName(args []string) string

func (*Command) FindRoot

func (d *Command) FindRoot() string

func (*Command) Flags

func (d *Command) Flags() *pflag.FlagSet

func (Command) HelpText

func (d Command) HelpText() string

HelpText returns the help Text of build function

func (Command) Name

func (d Command) Name() string

func (Command) ParentName

func (d Command) ParentName() string

func (*Command) ParseFlags

func (d *Command) ParseFlags(args []string)

func (*Command) Receive

func (d *Command) Receive(plugins []core.Plugin)

Receive and store initializers

func (*Command) Run

func (d *Command) Run(ctx context.Context, root string, args []string) error

Run each of the initializers and afterinitializers to compose the initial ox application.

type Initializer

type Initializer interface {
	// Initialize receives the context and the root folder where
	// the application is being initialized.
	Initialize(context.Context, Options) error
}

Initializer is intended to initialize applications, things like generating files or running commands.

type Options

type Options struct {
	Folder string
	Name   string
	Module string
	Root   string

	Args []string
}

Options that may come handy for the initializers.

Jump to

Keyboard shortcuts

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