sources

package
v2.1.1655 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTemplate

func ExecuteTemplate(content string, data interface{}) (string, error)

func Exists

func Exists(path string) bool

func WriteFile

func WriteFile(file *CodeFile, overwrite bool) error

func WriteFiles

func WriteFiles(files []CodeFile, overwrite bool) error

Types

type CodeFile

type CodeFile struct {
	Path    string
	Content string
}

type Sources

type Sources struct {
	Generated  []CodeFile
	Scaffolded []CodeFile
}

func NewSources

func NewSources() *Sources

func (*Sources) AddGenerated

func (sources *Sources) AddGenerated(files ...*CodeFile)

func (*Sources) AddGeneratedAll

func (sources *Sources) AddGeneratedAll(files []CodeFile)

func (*Sources) AddScaffolded

func (sources *Sources) AddScaffolded(files ...*CodeFile)

func (*Sources) AddScaffoldedAll

func (sources *Sources) AddScaffoldedAll(files []CodeFile)

func (*Sources) Write

func (sources *Sources) Write(overwriteAll bool) error

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(indentationStr string, leadSpacesIndentationSize int) *Writer

func (*Writer) EmptyLine

func (writer *Writer) EmptyLine()

func (*Writer) Indent

func (writer *Writer) Indent()

func (*Writer) IndentWith

func (writer *Writer) IndentWith(size int)

func (*Writer) Indented

func (writer *Writer) Indented() *Writer

func (*Writer) IndentedWith

func (writer *Writer) IndentedWith(size int) *Writer

func (*Writer) Line

func (writer *Writer) Line(format string, args ...interface{})

func (*Writer) String

func (writer *Writer) String() string

func (*Writer) Unindent

func (writer *Writer) Unindent()

func (*Writer) UnindentWith

func (writer *Writer) UnindentWith(size int)

Jump to

Keyboard shortcuts

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