newcontroller

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name   string
	Route  string
	Result string

	Index bool
	Show  bool
}

type Command

type Command struct {
	Path    string
	Actions []string
	// contains filtered or unexported fields
}

func New

func New(bud *bud.Command) *Command

func (*Command) Load

func (c *Command) Load() (state *State, err error)

func (*Command) Run

func (c *Command) Run(ctx context.Context) (err error)

func (*Command) Scaffold

func (c *Command) Scaffold(state *State) error

Scaffold the files from state

type Controller

type Controller struct {
	Imports []*imports.Import

	Package  string
	Name     string
	Pascal   string
	Struct   string
	Route    string
	Plural   string
	Singular string
	Actions  []*Action
	// contains filtered or unexported fields
}

type State

type State struct {
	Controller *Controller
	Views      []*View
}

type View

type View struct {
	Controller *Controller
	Path       string
	Title      string
	Variable   string
	Singular   string
	Plural     string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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