controller

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(fsys vfs.ReadWritable, state *State) error

Generate

Types

type Action

type Action struct {
	Name   string
	Route  string
	Result string

	Index bool
	Show  bool
}

type Command

type Command struct {
	bail.Struct

	Path    string
	Actions []string
	// contains filtered or unexported fields
}

func New

func New(module *gomod.Module) *Command

func (*Command) Load

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

func (*Command) Run

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

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 {
	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