output

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileWriterExtension is the extension to write files of.
	FileWriterExtension = ".go"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decorator

type Decorator interface {
	Decorate(content string) (string, error)
}

Decorator represents an interface to decorate the given content.

type FileWriter

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

FileWriter is a writer that writes to a file given by the path and the table name.

func NewFileWriter

func NewFileWriter(path string) *FileWriter

NewFileWriter constructs a new FileWriter.

func (FileWriter) Write

func (w FileWriter) Write(tableName string, content string) error

Write is the implementation of the Writer interface. The FilerWriter writes decorated content to the file specified by the given path and table name.

type FormatDecorator

type FormatDecorator struct{}

FormatDecorator applies a formatting decoration to the given content.

func (FormatDecorator) Decorate

func (FormatDecorator) Decorate(content string) (string, error)

Decorate is the implementation of the Decorator interface.

type ImportDecorator

type ImportDecorator struct{}

ImportDecorator removes empty import statements from the given content.

func (ImportDecorator) Decorate

func (ImportDecorator) Decorate(content string) (string, error)

Decorate is the implementation of the Decorator interface.

type Writer

type Writer interface {
	Write(tableName string, content string) error
}

Writer represents an interface to write the produced struct content.

Jump to

Keyboard shortcuts

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