resource

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 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 Generator added in v0.10.1

type Generator struct {
	App           meta.App     `json:"app"`
	Name          inflect.Name `json:"name"`
	Model         inflect.Name `json:"model"`
	SkipMigration bool         `json:"skip_migration"`
	SkipModel     bool         `json:"skip_model"`
	SkipTemplates bool         `json:"skip_templates"`
	UseModel      bool         `json:"use_model"`
	FilesPath     string       `json:"files_path"`
	ActionsPath   string       `json:"actions_path"`
	Props         []Prop       `json:"props"`
	Args          []string     `json:"args"`
}

Generator for generating a new resource

func New

func New(modelName string, args ...string) (Generator, error)

New constructs new options for generating a resource

func (Generator) Run added in v0.10.1

func (res Generator) Run(root string, data makr.Data) error

Run generates a new actions/resource file and a stub test.

func (Generator) Validate added in v0.10.1

func (o Generator) Validate() error

Validate that the options have what you need to build a new resource

type Prop added in v0.10.1

type Prop struct {
	Name inflect.Name
	Type string
}

Prop of a model. Starts as name:type on the command line.

func (Prop) String added in v0.10.1

func (m Prop) String() string

String representation of Prop

Jump to

Keyboard shortcuts

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