Documentation
¶
Index ¶
- Constants
- Variables
- type File
- func (f *File) AddComment(content string)
- func (f *File) AddImport(imp string)
- func (f *File) LB()
- func (f *File) MarshalJSON() ([]byte, error)
- func (f *File) Path() string
- func (f *File) Render() []string
- func (f *File) RenderString() string
- func (f *File) W(content string, indentDelta ...int)
- func (f *File) Wf(content string, args ...interface{})
- type FileType
- type Format
- type Formats
- type Result
- type Results
Constants ¶
View Source
const ( LangGo = "go" LangJSON = "json" )
Variables ¶
View Source
var ( FileTypeGo = FileType{Key: "go", Title: "Go", Icon: "file", Description: "Golang source code"} FileTypeJSON = FileType{Key: "json", Title: "JSON", Icon: "file", Description: "JavaScript object notation"} FileTypeText = FileType{Key: "text", Title: "Text", Icon: "file", Description: "Plain text"} FileTypeUnknown = FileType{Key: "unknown", Title: "unknown", Icon: "file", Description: "Unknown file type"} )
View Source
var AllFileTypes = []FileType{FileTypeGo, FileTypeText}
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Pkg util.Pkg
Filename string
Imports []string
Type FileType
// contains filtered or unexported fields
}
func (*File) AddComment ¶
func (*File) MarshalJSON ¶
func (*File) RenderString ¶
type FileType ¶
type FileType struct {
Key string `json:"key"`
Title string `json:"title,omitempty"`
Icon string `json:"icon,omitempty"`
Description string `json:"description,omitempty"`
}
func FileTypeFromString ¶
func (*FileType) MarshalJSON ¶
func (*FileType) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.