Documentation ¶
Index ¶
- func NormalizeToKebabCase(s string) string
- func ParamsUsage(names []string, types []ParamType) string
- type Metadata
- func (md *Metadata) Aliases() []string
- func (md *Metadata) Child(name string) *Metadata
- func (md *Metadata) Long() string
- func (md *Metadata) Lookup(pkgPath, name string) *Metadata
- func (md *Metadata) LookupType(t reflect.Type) *Metadata
- func (md *Metadata) Short() string
- func (md *Metadata) Usage(name string, args []ParamType) string
- type ParamType
- type Plan
- type RawMetadata
- type RunOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeToKebabCase ¶
NormalizeToKebabCase normalizes the input string to ASCII kebab-case. It tries to convert non-ASCII runes in the input string to ASCII by decomposing and then dropping all non-ASCII runes (and so is lossy). It supports camelCase, PascalCase, snake_case, and SCREAMING_SNAKE_CASE -- anything else (including digits mixed in) working is a happy accident.
func ParamsUsage ¶
Types ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
func DecodeAsMetadata ¶
type RawMetadata ¶
type RawMetadata struct { Doc string Directives map[string]string Comment string Params []string Children map[string]*RawMetadata }
Note: it's important that all fields of RawMetadata be exported, otherwise gob won't be able to encode / decode them correctly.
func DecodeAsRawMetadata ¶
func DecodeAsRawMetadata(b []byte) *RawMetadata
func (*RawMetadata) Child ¶
func (rmd *RawMetadata) Child(name string) *RawMetadata
func (*RawMetadata) Encode ¶
func (rmd *RawMetadata) Encode() []byte
func (*RawMetadata) SetComment ¶
func (rmd *RawMetadata) SetComment(comment *ast.CommentGroup)
func (*RawMetadata) SetDoc ¶
func (rmd *RawMetadata) SetDoc(doc *ast.CommentGroup)
type RunOptions ¶
type RunOptions struct {
Metadata *[]byte
}
Click to show internal directories.
Click to hide internal directories.