Documentation ¶
Index ¶
- func DisableLog() func(opt *Options)
- func GetDeleteFileFunction(cfg Config, fileName string) func() error
- func TempFile() func(opt *Options)
- func Write(w Writer, opts ...func(opt *Options)) error
- func WriteOnce() func(opt *Options)
- func WriteOnceMaybe(forceOverwrite bool) func(opt *Options)
- type Config
- type JSONFileWriter
- type Options
- type TemplatedBasedFileWriter
- type Writer
- type YamlFileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog() func(opt *Options)
DisableLog disables the log that the file was written
func GetDeleteFileFunction ¶ added in v0.0.39
func TempFile ¶ added in v0.0.38
func TempFile() func(opt *Options)
TempFile flags a file as temporary so that we don't attempt to do any processing on it after the fact e.g. prettier
func WriteOnce ¶
func WriteOnce() func(opt *Options)
WriteOnce specifes that writing to path provided should not occur if the file already exists This is usually configured via code
func WriteOnceMaybe ¶
WriteOnceMaybe takes a flag (usually provided via user action) and determines if we should add the writeOnce flag to Options
Types ¶
type JSONFileWriter ¶ added in v0.0.38
func (*JSONFileWriter) Write ¶ added in v0.0.38
func (fw *JSONFileWriter) Write(opts ...func(opt *Options)) error
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options provides a way to configure the file writing process as needed
type TemplatedBasedFileWriter ¶
type TemplatedBasedFileWriter struct { Data interface{} AbsPathToTemplate string OtherTemplateFiles []string // should also be an absolute path TemplateName string PathToFile string FuncMap template.FuncMap PackageName string TsImports *tsimport.Imports Config Config EditableCode bool }
func (*TemplatedBasedFileWriter) Write ¶
func (fw *TemplatedBasedFileWriter) Write(opts ...func(opt *Options)) error
type YamlFileWriter ¶
func (*YamlFileWriter) Write ¶
func (fw *YamlFileWriter) Write(opts ...func(opt *Options)) error
Click to show internal directories.
Click to hide internal directories.