Documentation ¶
Index ¶
- Constants
- Variables
- func BuildInlineOptions[T any](ojbs []T) string
- func BuildInlineOptionsWithModifier[T any](ojbs []T, fun func(T) string) string
- func BuildOptions[T any](ojbs []T) string
- func BuildOptionsWithModifier[T any](ojbs []T, fun func(T) string) string
- func ChooseIndex(scanner *bufio.Scanner, typ string, holders []OperationHolder) int
- func ChooseType[T any](scanner *bufio.Scanner, opts []T) T
- func IsValidName(val string) bool
- func ParseOptions[T any](input string, options []T) (int, error)
- func SigForOperation(op Operation) string
- type AppBuilder
- type GeneralCommand
- type Generator
- type NextOperation
- type Operation
- type OperationHolder
- type Stack
Constants ¶
View Source
const ( StatusAppBuilding int = iota // Start to build an app, should given the appname and version StatusComponentBuilding // Start to build a component in the app. StatusFileBuilding // Start to build a file in app layer or component layer StatusFileBuilded // File builded, to start a new session or return parent StatusComponentBuilded // Component builded, to start a new component session StatusAppBuilded // App builded, to start the content generating. StatusAppGenerateFailed // App content writing, incase failure. StatusAppGenerated // Generated, next to finished or modify )
View Source
const NamePatternString = "[a-zA-Z][a-z0-9A-Z-]{0,62}[a-z0-9A-Z]"
Variables ¶
Functions ¶
func BuildInlineOptions ¶
func BuildOptions ¶
func ChooseIndex ¶
func ChooseIndex(scanner *bufio.Scanner, typ string, holders []OperationHolder) int
func ChooseType ¶
func IsValidName ¶
func SigForOperation ¶
Types ¶
type AppBuilder ¶
type AppBuilder interface {
Build() *manifest.AppManifests
}
Build AppManifests from model.
type GeneralCommand ¶
type GeneralCommand string
const ( OP_NOOP GeneralCommand = "noop" OP_Finish GeneralCommand = "finished" OP_Cancel GeneralCommand = "cancel" OP_Generate GeneralCommand = "generate" )
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
type NextOperation ¶
type NextOperation interface { NextOperation(scanner *bufio.Scanner) []Operation // 列出可选类型,并选择 Create(scanner *bufio.Scanner) OperationHolder Modify(scanner *bufio.Scanner) OperationHolder Remove(scanner *bufio.Scanner) General(scanner *bufio.Scanner) GeneralCommand }
type OperationHolder ¶
Click to show internal directories.
Click to hide internal directories.