Documentation
¶
Index ¶
- Variables
- func AddRuntimeFile(unit *core.ExecutionUnit, templateData any, path string, content []byte) error
- func DeleteImportNodes(f *core.SourceFile) error
- func FindFilesForPackageName(unit *core.ExecutionUnit, pkgName string) []*core.SourceFile
- func NewFile(path string, content io.Reader) (f *core.SourceFile, err error)
- func UpdateGoModWithHandlerRequirements(unit *core.ExecutionUnit) error
- func UpdateImportWithHandlerRequirements(imports *sitter.Node, f *core.SourceFile) error
- func UpdateImportsInFile(f *core.SourceFile, importsToAdd []Import, importsToRemove []Import) error
- func UpdateListenWithHandlerCode(oldFileContent string, nodeToComment string, appName string) string
- type AddExecRuntimeFiles
- type Expose
- type GoMod
- type GoPlugins
- type GolangExecutable
- type Import
- type Package
- type Runtime
Constants ¶
This section is empty.
Variables ¶
View Source
var Language = core.SourceLanguage{ ID: goLang, Sitter: golang.GetLanguage(), CapabilityFinder: lang.NewCapabilityFinder("comment", lang.CompositePreprocessor( lang.RegexpRemovePreprocessor(`//\s*`), func(comment string) string { if !strings.HasPrefix(comment, "/*") { return comment } comment = comment[1 : len(comment)-1] comment = multilineCommentMarginRegexp.ReplaceAllString(comment, "") return comment }, )), }
Functions ¶
func AddRuntimeFile ¶
func DeleteImportNodes ¶ added in v0.6.2
func DeleteImportNodes(f *core.SourceFile) error
func FindFilesForPackageName ¶ added in v0.6.2
func FindFilesForPackageName(unit *core.ExecutionUnit, pkgName string) []*core.SourceFile
func UpdateGoModWithHandlerRequirements ¶
func UpdateGoModWithHandlerRequirements(unit *core.ExecutionUnit) error
func UpdateImportWithHandlerRequirements ¶
func UpdateImportWithHandlerRequirements(imports *sitter.Node, f *core.SourceFile) error
func UpdateImportsInFile ¶ added in v0.6.2
func UpdateImportsInFile(f *core.SourceFile, importsToAdd []Import, importsToRemove []Import) error
func UpdateListenWithHandlerCode ¶
func UpdateListenWithHandlerCode(oldFileContent string, nodeToComment string, appName string) string
UpdateListenWithHandlerCode takes the old http.ListenAndServe string and comments it out. Then it appends the the lambda handler code right after. Dependencies are not added at this stage
Types ¶
type AddExecRuntimeFiles ¶
type AddExecRuntimeFiles struct {
// contains filtered or unexported fields
}
func (*AddExecRuntimeFiles) Name ¶
func (p *AddExecRuntimeFiles) Name() string
func (*AddExecRuntimeFiles) Transform ¶
func (p *AddExecRuntimeFiles) Transform(result *core.CompilationResult, deps *core.Dependencies) error
type Expose ¶
type Expose struct {
Config *config.Application
}
func (Expose) Transform ¶
func (p Expose) Transform(result *core.CompilationResult, deps *core.Dependencies) error
type GoPlugins ¶
func NewGoPlugins ¶
func NewGoPlugins(cfg *config.Application, runtime Runtime) *GoPlugins
func (GoPlugins) Transform ¶
func (c GoPlugins) Transform(result *core.CompilationResult, deps *core.Dependencies) error
type GolangExecutable ¶
type GolangExecutable struct {
}
func (GolangExecutable) Name ¶
func (l GolangExecutable) Name() string
func (GolangExecutable) Transform ¶
func (l GolangExecutable) Transform(result *core.CompilationResult, dependencies *core.Dependencies) error
type Import ¶ added in v0.6.2
func GetImportsInFile ¶ added in v0.6.2
func GetImportsInFile(f *core.SourceFile) []Import
type Package ¶ added in v0.6.2
func FindPackageNode ¶ added in v0.6.2
func FindPackageNode(f *core.SourceFile) Package
type Runtime ¶
type Runtime interface {
AddExecRuntimeFiles(unit *core.ExecutionUnit, result *core.CompilationResult, deps *core.Dependencies) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.