Documentation ¶
Index ¶
- Constants
- func FormatFile(context cgi.ContextInterface, file *File) (string, error)
- func FormatGoString(content string) (string, error)
- func GoFileTemplates() cgi.TemplateSetInterface
- func MaybeSignFile(context cgi.ContextInterface, file *File) (string, error)
- func Save(context cgi.ContextInterface, file *File) error
- func SignFile(context cgi.ContextInterface, file *File) (string, error)
- type Destination
- type File
- func (f *File) Add(nodes ...cgi.NodeInterface) *File
- func (f *File) AllowWriteIfFormatFails() *File
- func (f *File) Contents(contents []cgi.NodeInterface) *File
- func (f *File) Generate(c cgi.ContextInterface) (cgi.NodeOutputInterface, error)
- func (f *File) HeaderString() string
- func (f *File) ImportsUsed(imports *cgelement.ImportSet) (*File, error)
- func (f *File) Package(packageName string) *File
- func (f *File) Save(c cgi.ContextInterface) error
- func (f *File) SetHeader(header string) *File
- func (f *File) ToInterface() cgi.NodeInterface
- func (f *File) UsedImports() (cgi.ImportSetInterface, error)
- type FileData
Constants ¶
View Source
const DefaultPackageName = "main"
View Source
const PartiallyGeneratedBegin = "BEGIN MANUAL SECTION"
View Source
const PartiallyGeneratedEnd = "END MANUAL SECTION"
Variables ¶
This section is empty.
Functions ¶
func FormatFile ¶
func FormatFile(context cgi.ContextInterface, file *File) (string, error)
func FormatGoString ¶
func GoFileTemplates ¶
func GoFileTemplates() cgi.TemplateSetInterface
func MaybeSignFile ¶
func MaybeSignFile(context cgi.ContextInterface, file *File) (string, error)
Types ¶
type Destination ¶
func NewDestination ¶
func NewDestination(name, path string) *Destination
func (*Destination) Write ¶
func (d *Destination) Write(context cgi.ContextInterface, content string) error
type File ¶
type File struct {
// contains filtered or unexported fields
}
func NewFile ¶
func NewFile(destination *Destination) *File
func NewFileWithoutGeneratorHeadersOrSigning ¶
func NewFileWithoutGeneratorHeadersOrSigning(destination *Destination) *File
intentionally verbose
func NewPartiallyGeneratedFile ¶
func NewPartiallyGeneratedFile(destination *Destination) *File
func (*File) AllowWriteIfFormatFails ¶
func (*File) Generate ¶
func (f *File) Generate(c cgi.ContextInterface) (cgi.NodeOutputInterface, error)
func (*File) HeaderString ¶
func (*File) ToInterface ¶
func (f *File) ToInterface() cgi.NodeInterface
func (*File) UsedImports ¶
func (f *File) UsedImports() (cgi.ImportSetInterface, error)
type FileData ¶
type FileData struct { // generate line comment for partially/fully generated files GoGenerateCommentLine *cgelement.LineComment // generated by line comment for fully generated files GeneratedFileCommentLine *cgelement.LineComment // header comment Header cgi.NodeOutputInterface // package of this file PackageName string // union of imports used in the file Imports cgi.ImportSetInterface // set of content in the file Contents []cgi.NodeOutputInterface }
Click to show internal directories.
Click to hide internal directories.