Documentation
¶
Index ¶
- func FindRepoRoot() (string, error)
- func Generated(opts Options) error
- func PathContains(elem ...string) func(path string) bool
- type FieldMatcher
- type Options
- type Replacement
- func AddStructField(match TypeMatcher, fieldName, fieldType, fieldTag string) Replacement
- func EnsureNamedImports(imports map[string]string) Replacement
- func IfPath(match func(path string) bool, replacements ...Replacement) Replacement
- func RegexReplaceAll(re *regexp.Regexp, replacement string) Replacement
- func Replace(o, n string, c int) Replacement
- func ReplaceAll(o, n string) Replacement
- func ReplaceFieldType(match FieldMatcher, replacementType string) Replacement
- func SetStructFields(match TypeMatcher, fields []StructFieldSpec) Replacement
- func SetTypeExpr(match TypeMatcher, replacementType string) Replacement
- type StructFieldSpec
- type TypeMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindRepoRoot ¶
func PathContains ¶
Types ¶
type FieldMatcher ¶
func AllFields ¶
func AllFields(matchers ...FieldMatcher) FieldMatcher
func FieldNamed ¶
func FieldNamed(names ...string) FieldMatcher
func FieldTypeEquals ¶
func FieldTypeEquals(typeExpr string) FieldMatcher
type Replacement ¶
func AddStructField ¶
func AddStructField(match TypeMatcher, fieldName, fieldType, fieldTag string) Replacement
func EnsureNamedImports ¶
func EnsureNamedImports(imports map[string]string) Replacement
func IfPath ¶
func IfPath(match func(path string) bool, replacements ...Replacement) Replacement
func RegexReplaceAll ¶
func RegexReplaceAll(re *regexp.Regexp, replacement string) Replacement
func Replace ¶
func Replace(o, n string, c int) Replacement
func ReplaceAll ¶
func ReplaceAll(o, n string) Replacement
func ReplaceFieldType ¶
func ReplaceFieldType(match FieldMatcher, replacementType string) Replacement
func SetStructFields ¶
func SetStructFields(match TypeMatcher, fields []StructFieldSpec) Replacement
func SetTypeExpr ¶
func SetTypeExpr(match TypeMatcher, replacementType string) Replacement
type StructFieldSpec ¶
type TypeMatcher ¶
func AnyType ¶
func AnyType(matchers ...TypeMatcher) TypeMatcher
func TypeNamed ¶
func TypeNamed(names ...string) TypeMatcher
Click to show internal directories.
Click to hide internal directories.