Documentation ¶
Index ¶
- type Aggregate
- type Application
- type ConfigureMethod
- type Context
- func (c *Context) Error(n ast.Node, format string, args ...any) *diagnostic.Diagnostic
- func (c *Context) Improvement(n ast.Node, format string, args ...any) *diagnostic.Diagnostic
- func (c *Context) Report(s diagnostic.Severity, n ast.Node, format string, args ...any) *diagnostic.Diagnostic
- func (c *Context) Warning(n ast.Node, format string, args ...any) *diagnostic.Diagnostic
- type Dogma
- type Entity
- type Handler
- type Integration
- type Process
- type Projection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
type Aggregate struct{ Handler }
Aggregate contains information about a type that implements [dogma.AggregateMessageHandler].
type Application ¶
type Application struct{ Entity }
Application contains information about a type that implements [dogma.Application].
type ConfigureMethod ¶
type ConfigureMethod struct { Declaration *ast.FuncDecl Implementation *ssa.Function Configurer *ssa.Parameter }
ConfigureMethod describes the Configure() method of an application or handler.
func (*ConfigureMethod) IsConfigurerCall ¶
func (m *ConfigureMethod) IsConfigurerCall(c *ssa.Call, method string) bool
IsConfigurerCall returns true if c is a call to a specific method of the entity's configurer.
type Context ¶
type Context struct { Package *packages.Package SSAProgram *ssa.Program SSAPackage *ssa.Package Dogma *Dogma Entities []Entity Applications []Application Handlers []Handler Aggregates []Aggregate Processes []Process Integrations []Integration Projections []Projection Diagnostics []*diagnostic.Diagnostic }
Context encapsulates the information available to a linter, and provides a way for the linter to report diagnostics.
func NewContext ¶
NewContext creates a new linter context for the linting the given package.
func (*Context) Error ¶
func (c *Context) Error( n ast.Node, format string, args ...any, ) *diagnostic.Diagnostic
Error reports an error about the given AST node.
func (*Context) Improvement ¶
func (c *Context) Improvement( n ast.Node, format string, args ...any, ) *diagnostic.Diagnostic
Improvement reports an improvement that can be made to the given AST node.
func (*Context) Report ¶
func (c *Context) Report( s diagnostic.Severity, n ast.Node, format string, args ...any, ) *diagnostic.Diagnostic
Report reports a diagnostic about the given AST node.
func (*Context) Warning ¶
func (c *Context) Warning( n ast.Node, format string, args ...any, ) *diagnostic.Diagnostic
Warning reports a warning about the given AST node.
type Dogma ¶
type Dogma struct { Package *types.Package Application *types.Interface AggregateMessageHandler *types.Interface ProcessMessageHandler *types.Interface ProjectionMessageHandler *types.Interface IntegrationMessageHandler *types.Interface }
Dogma encapsulates information about the dogma package and the types within it.
type Entity ¶
type Entity struct { Type types.Type ConfigureMethod ConfigureMethod }
Entity is an application or handler.
type Handler ¶
type Handler = struct{ Entity }
Handler contains information about a type that implements one of Dogma's handler interfaces.
type Integration ¶
type Integration struct{ Handler }
Integration contains information about a type that implements [dogma.IntegrationMessageHandler].
type Process ¶
type Process struct{ Handler }
Process contains information about a type that implements [dogma.ProcessMessageHandler].
type Projection ¶
type Projection struct{ Handler }
Projection contains information about a type that implements [dogma.ProjectionMessageHandler].