cgfile

package
v0.0.0-...-c990d3b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

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 FormatGoString(content string) (string, error)

func GoFileTemplates

func GoFileTemplates() cgi.TemplateSetInterface

func MaybeSignFile

func MaybeSignFile(context cgi.ContextInterface, file *File) (string, error)

func Save

func Save(context cgi.ContextInterface, file *File) error

func SignFile

func SignFile(context cgi.ContextInterface, file *File) (string, error)

Types

type Destination

type Destination struct {
	Name string
	Path string
}

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) Add

func (f *File) Add(nodes ...cgi.NodeInterface) *File

func (*File) AllowWriteIfFormatFails

func (f *File) AllowWriteIfFormatFails() *File

func (*File) Contents

func (f *File) Contents(contents []cgi.NodeInterface) *File

func (*File) Generate

func (*File) HeaderString

func (f *File) HeaderString() string

func (*File) ImportsUsed

func (f *File) ImportsUsed(imports *cgelement.ImportSet) (*File, error)

func (*File) Package

func (f *File) Package(packageName string) *File

func (*File) Save

func (f *File) Save(c cgi.ContextInterface) error

func (*File) SetHeader

func (f *File) SetHeader(header string) *File

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
}

Jump to

Keyboard shortcuts

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