Documentation
¶
Index ¶
- func ApplyTemplate(t string, data any) (string, error)
- func ApplyTemplateFrom(ctx context.Context, fs shared.FileSystem, f string, obj any) (string, error)
- func Copy(ctx context.Context, fs shared.FileSystem, f string, destination string) error
- func CopyAndApply(ctx context.Context, fs shared.FileSystem, root string, destination string, ...) error
- func CopyAndApplyTemplate(ctx context.Context, fs shared.FileSystem, f string, destination string, ...) error
- func CopyAndReplace(ctx context.Context, fs shared.FileSystem, f string, destination string, ...) error
- func CopyAndVisit(ctx context.Context, fs shared.FileSystem, root string, destination string, ...) error
- func Walk(ctx context.Context, fs shared.FileSystem, root string, ...) error
- type AddTemplateSuffix
- type AlreadyExistError
- type CutTemplateSuffix
- type FileVisitor
- type NameReplacer
- type Replacer
- type ServiceReplacer
- type TemplateVisitor
- type Templator
- func (t *Templator) CopyAndApply(ctx context.Context, fs shared.FileSystem, root string, destination string, ...) error
- func (t *Templator) Keep(name string) bool
- func (t *Templator) NewName(base string) string
- func (t *Templator) Replace(p string) bool
- func (t *Templator) WalkAndVisit(ctx context.Context, fs shared.FileSystem, root string, destinationDir string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTemplate ¶
ApplyTemplate takes a YAML template as []byte, populates it using data, and returns the result as a string.
func ApplyTemplateFrom ¶ added in v0.0.26
func CopyAndApply ¶
func CopyAndApplyTemplate ¶
func CopyAndReplace ¶
func CopyAndVisit ¶
func CopyAndVisit(ctx context.Context, fs shared.FileSystem, root string, destination string, nameReplacer NameReplacer, visitor FileVisitor) error
Types ¶
type AddTemplateSuffix ¶ added in v0.1.23
type AddTemplateSuffix struct { }
func (AddTemplateSuffix) NewName ¶ added in v0.1.23
func (AddTemplateSuffix) NewName(base string) string
type AlreadyExistError ¶
type AlreadyExistError struct {
// contains filtered or unexported fields
}
func (AlreadyExistError) Error ¶
func (a AlreadyExistError) Error() string
type CutTemplateSuffix ¶ added in v0.1.23
type CutTemplateSuffix struct { }
func (CutTemplateSuffix) NewName ¶ added in v0.1.23
func (CutTemplateSuffix) NewName(base string) string
type FileVisitor ¶
type NameReplacer ¶ added in v0.1.23
type ServiceReplacer ¶
type ServiceReplacer struct {
// contains filtered or unexported fields
}
func NewServiceReplacer ¶
func NewServiceReplacer(gen *generation.Service) *ServiceReplacer
type TemplateVisitor ¶ added in v0.1.23
type TemplateVisitor struct {
// contains filtered or unexported fields
}
type Templator ¶ added in v0.1.18
type Templator struct { PathSelect shared.PathSelect Override shared.Override NameReplacer }
func (*Templator) CopyAndApply ¶ added in v0.1.18
func (*Templator) WalkAndVisit ¶ added in v0.1.23
func (t *Templator) WalkAndVisit(ctx context.Context, fs shared.FileSystem, root string, destinationDir string, visitor FileVisitor) error
Click to show internal directories.
Click to hide internal directories.