resource

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct{}

Generator allows to identify resource as a plugin

func (Generator) Generate

func (g Generator) Generate(ctx context.Context, root string, args []string) error

Generate generates the actions, model, templates and migration files from the given attrs app/actions/name.go app/actions/name_test.go app/models/name.go app/models/name_test.go app/templates/name/index.plush.html app/templates/name/new.plush.html app/templates/name/edit.plush.html app/templates/name/show.plush.html migrations/name.up.fizz migrations/name.down.fizz

func (Generator) InvocationName added in v1.5.2

func (g Generator) InvocationName() string

InvocationName is used to identify the generator when the generate command is called.

func (Generator) Name

func (g Generator) Name() string

Name returns the name of the plugin

type Resource

type Resource struct {
	Actions  []name.Ident
	Name     name.Ident
	Model    model.Model
	ModelPkg string
	Args     []string
	// contains filtered or unexported fields
}

Resource model struct

func New

func New(root string, args []string) *Resource

New creates a new instance of Resource

func (*Resource) GenerateActions

func (r *Resource) GenerateActions() error

GenerateActions generates the actions for the resource

func (*Resource) GenerateMigrations

func (r *Resource) GenerateMigrations() error

GenerateModel generates the migrations for the resource

func (*Resource) GenerateModel

func (r *Resource) GenerateModel() error

GenerateModel generates the model for the resource

func (*Resource) GenerateTemplates

func (r *Resource) GenerateTemplates() error

GenerateModel generates the templates for the resource

Jump to

Keyboard shortcuts

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