Documentation ¶
Index ¶
- Variables
- func CollectEntries(path string) ([]annotation.Entry, error)
- func NewTemplate() (*template.Template, error)
- func WithLogger(logger Logger)
- type Annotation
- type AnnotationIDType
- type AnnotationType
- type Component
- type DefaultLogger
- func (n DefaultLogger) Debug(args ...interface{})
- func (n DefaultLogger) Debugf(format string, args ...interface{})
- func (n DefaultLogger) Error(args ...interface{})
- func (n DefaultLogger) Errorf(format string, args ...interface{})
- func (n DefaultLogger) Fatal(args ...interface{})
- func (n DefaultLogger) Fatalf(format string, args ...interface{})
- func (n DefaultLogger) Info(args ...interface{})
- func (n DefaultLogger) Infof(format string, args ...interface{})
- func (n DefaultLogger) Panic(args ...interface{})
- func (n DefaultLogger) Panicf(format string, args ...interface{})
- func (n DefaultLogger) Trace(args ...interface{})
- func (n DefaultLogger) Tracef(format string, args ...interface{})
- func (n DefaultLogger) Warn(args ...interface{})
- func (n DefaultLogger) Warnf(format string, args ...interface{})
- type Generator
- type Graph
- type ImportData
- type Logger
- type ModuleAttr
- type ModuleData
- type Vertex
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAnnotationIDType = errors.New("not a valid AnnotationIDType")
var ErrInvalidAnnotationType = errors.New("not a valid AnnotationType")
var ErrInvalidModuleAttr = errors.New("not a valid ModuleAttr")
Functions ¶
func CollectEntries ¶
func CollectEntries(path string) ([]annotation.Entry, error)
func NewTemplate ¶
func WithLogger ¶
func WithLogger(logger Logger)
Types ¶
type Annotation ¶
func (*Annotation) ID ¶
func (a *Annotation) ID() string
type AnnotationIDType ¶
type AnnotationIDType int
ENUM(DEFAULT,NAMED,GROUPED)
const ( // AnnotationIDTypeDEFAULT is a AnnotationIDType of type DEFAULT. AnnotationIDTypeDEFAULT AnnotationIDType = iota // AnnotationIDTypeNAMED is a AnnotationIDType of type NAMED. AnnotationIDTypeNAMED // AnnotationIDTypeGROUPED is a AnnotationIDType of type GROUPED. AnnotationIDTypeGROUPED )
func ParseAnnotationIDType ¶
func ParseAnnotationIDType(name string) (AnnotationIDType, error)
ParseAnnotationIDType attempts to convert a string to a AnnotationIDType.
func (AnnotationIDType) IsValid ¶
func (x AnnotationIDType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AnnotationIDType) MarshalText ¶
func (x AnnotationIDType) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (AnnotationIDType) String ¶
func (x AnnotationIDType) String() string
String implements the Stringer interface.
func (*AnnotationIDType) UnmarshalText ¶
func (x *AnnotationIDType) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type AnnotationType ¶
type AnnotationType int
ENUM(MODULE,PROVIDE,INJECT,INVOKE)
const ( // AnnotationTypeMODULE is a AnnotationType of type MODULE. AnnotationTypeMODULE AnnotationType = iota // AnnotationTypePROVIDE is a AnnotationType of type PROVIDE. AnnotationTypePROVIDE // AnnotationTypeINJECT is a AnnotationType of type INJECT. AnnotationTypeINJECT // AnnotationTypeINVOKE is a AnnotationType of type INVOKE. AnnotationTypeINVOKE )
func ParseAnnotationType ¶
func ParseAnnotationType(name string) (AnnotationType, error)
ParseAnnotationType attempts to convert a string to a AnnotationType.
func (AnnotationType) IsValid ¶
func (x AnnotationType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AnnotationType) MarshalText ¶
func (x AnnotationType) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (AnnotationType) String ¶
func (x AnnotationType) String() string
String implements the Stringer interface.
func (*AnnotationType) UnmarshalText ¶
func (x *AnnotationType) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Component ¶
type Component struct { Entry annotation.Entry An Annotation }
type DefaultLogger ¶
type DefaultLogger struct{}
func (DefaultLogger) Debug ¶
func (n DefaultLogger) Debug(args ...interface{})
func (DefaultLogger) Debugf ¶
func (n DefaultLogger) Debugf(format string, args ...interface{})
func (DefaultLogger) Error ¶
func (n DefaultLogger) Error(args ...interface{})
func (DefaultLogger) Errorf ¶
func (n DefaultLogger) Errorf(format string, args ...interface{})
func (DefaultLogger) Fatal ¶
func (n DefaultLogger) Fatal(args ...interface{})
func (DefaultLogger) Fatalf ¶
func (n DefaultLogger) Fatalf(format string, args ...interface{})
func (DefaultLogger) Info ¶
func (n DefaultLogger) Info(args ...interface{})
func (DefaultLogger) Infof ¶
func (n DefaultLogger) Infof(format string, args ...interface{})
func (DefaultLogger) Panic ¶
func (n DefaultLogger) Panic(args ...interface{})
func (DefaultLogger) Panicf ¶
func (n DefaultLogger) Panicf(format string, args ...interface{})
func (DefaultLogger) Trace ¶
func (n DefaultLogger) Trace(args ...interface{})
func (DefaultLogger) Tracef ¶
func (n DefaultLogger) Tracef(format string, args ...interface{})
func (DefaultLogger) Warn ¶
func (n DefaultLogger) Warn(args ...interface{})
func (DefaultLogger) Warnf ¶
func (n DefaultLogger) Warnf(format string, args ...interface{})
type Graph ¶
type Graph[T any] struct { // contains filtered or unexported fields }
Graph represents a generic graph structure with vertices of any type. It includes maps for vertices, incoming edges, and edges for efficient graph operations.
func NewGraphFromEntries ¶
func (*Graph[T]) AddEdge ¶
AddEdge adds a directed edge from one vertex to another. If either vertex does not exist, it logs a warning and does not add the edge.
func (*Graph[T]) AddVertex ¶
AddVertex adds a new vertex with the specified key and value to the graph. If the vertex already exists, it logs a warning and does not overwrite it.
func (*Graph[T]) ExportToGraphviz ¶
func (*Graph[T]) VerticesWithNoIncomingEdges ¶
VerticesWithNoIncomingEdges returns a list of vertices with no incoming edges.
type ImportData ¶
type ImportData struct { Alias string Path string Entry annotation.Entry }
type Logger ¶
type Logger interface { Tracef(format string, args ...interface{}) Trace(args ...interface{}) Debugf(format string, args ...interface{}) Debug(args ...interface{}) Infof(format string, args ...interface{}) Info(args ...interface{}) Warnf(format string, args ...interface{}) Warn(args ...interface{}) Errorf(format string, args ...interface{}) Error(args ...interface{}) Fatalf(format string, args ...interface{}) Fatal(args ...interface{}) Panicf(format string, args ...interface{}) Panic(args ...interface{}) }
Logger is our contract for the logger.
type ModuleAttr ¶
type ModuleAttr int
ENUM(MODULE,PATH,PACKAGE,FUNC)
const ( // ModuleAttrMODULE is a ModuleAttr of type MODULE. ModuleAttrMODULE ModuleAttr = iota // ModuleAttrPATH is a ModuleAttr of type PATH. ModuleAttrPATH // ModuleAttrPACKAGE is a ModuleAttr of type PACKAGE. ModuleAttrPACKAGE // ModuleAttrFUNC is a ModuleAttr of type FUNC. ModuleAttrFUNC )
func ParseModuleAttr ¶
func ParseModuleAttr(name string) (ModuleAttr, error)
ParseModuleAttr attempts to convert a string to a ModuleAttr.
func (ModuleAttr) IsValid ¶
func (x ModuleAttr) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ModuleAttr) MarshalText ¶
func (x ModuleAttr) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (ModuleAttr) String ¶
func (x ModuleAttr) String() string
String implements the Stringer interface.
func (*ModuleAttr) UnmarshalText ¶
func (x *ModuleAttr) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type ModuleData ¶
type ModuleData struct { PackageName string FunctionName string ImportPath string Modules []ImportData Imports []ImportData Alias string Entry annotation.Entry Type string }
type Vertex ¶
type Vertex[T any] struct { Key string // Unique identifier of the vertex. Value T // Value stored in the vertex. // contains filtered or unexported fields }
Vertex represents a node in a graph with a key and a value. It also holds a reference to the graph it belongs to for graph operations.