analysis

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(config CheckConfiguration, wd string, log *log.Logger, fileSet *token.FileSet, pl []*packages.Package) error

Types

type CheckConfiguration

type CheckConfiguration struct {
	Verbose           bool
	TemplatesVariable string
}

type Definition

type Definition struct {
	String    string
	Separator string
	Source    string
}

type DefinitionsConfiguration

type DefinitionsConfiguration struct {
	Verbose           bool
	ReceiverPackage   string
	PackageName       string
	PackagePath       string
	ReceiverType      string
	TemplatesVariable string
}

type Function

type Function struct {
	Name      string
	Signature string
}

type NamedReferences

type NamedReferences struct {
	Name       string
	Imports    *astgen.TypeFormatter `json:",omitempty"`
	References []TemplateReference
}

func NewNamedReferences

func NewNamedReferences(pkgPath, name string, refs []TemplateReference) NamedReferences

type ReceiverMethod

type ReceiverMethod struct {
	Name      string
	Signature string
}

type Routes

type Routes struct {
	Functions       []Function
	Definitions     []Definition
	Receiver        *types.Named
	ReceiverMethods []ReceiverMethod
}

func NewRoutes

func NewRoutes(config DefinitionsConfiguration, wd string, _ *token.FileSet, pl []*packages.Package) (*Routes, error)

func (*Routes) WriteTo

func (result *Routes) WriteTo(w io.Writer) (int64, error)

type TemplateCallers

type TemplateCallers struct {
	Templates []NamedReferences
}

func NewTemplateCallers

func NewTemplateCallers(config TemplateCallersConfiguration, fileSet *token.FileSet, pkg *packages.Package, global *check.Global, ts *template.Template) (*TemplateCallers, error)

NewTemplateCallers shows where templates are referenced

func (*TemplateCallers) WriteTo

func (result *TemplateCallers) WriteTo(w io.Writer) (int64, error)

type TemplateCallersConfiguration

type TemplateCallersConfiguration struct {
	TemplatesVariable string
	FilterTemplates   []*regexp.Regexp
}

type TemplateCalls

type TemplateCalls struct {
	Templates []NamedReferences
}

func NewTemplateCalls

func NewTemplateCalls(config TemplateCallsConfiguration, pkg *packages.Package, global *check.Global, ts *template.Template) (*TemplateCalls, error)

NewTemplateCalls shows what templates use (other templates they call)

func (*TemplateCalls) WriteTo

func (result *TemplateCalls) WriteTo(w io.Writer) (int64, error)

type TemplateCallsConfiguration

type TemplateCallsConfiguration struct {
	TemplatesVariable string
	FilterTemplates   []*regexp.Regexp
}

type TemplateExecution

type TemplateExecution struct {
	token.Position

	Name string
	Type string
	// contains filtered or unexported fields
}

type TemplateReference

type TemplateReference struct {
	Name     string
	Kind     TemplateReferenceKind
	Position token.Position

	Data string `json:",omitempty"`
	// contains filtered or unexported fields
}

type TemplateReferenceKind

type TemplateReferenceKind int
const (
	ParseTemplateNode TemplateReferenceKind = 1 + iota
	ExecuteTemplateNode
)

func (TemplateReferenceKind) MarshalText

func (k TemplateReferenceKind) MarshalText() (text []byte, err error)

func (TemplateReferenceKind) String

func (k TemplateReferenceKind) String() string

Jump to

Keyboard shortcuts

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