Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateProviderIdentifiers = errors.New("duplicate provider identifiers found which were not overridden")
Functions ¶
This section is empty.
Types ¶
type EmbeddedComponent ¶
type EmbeddedComponent struct { Identifier PackageAlias string ImportPath string Imports []string Functions map[Identifier]struct{} Singletons []Identifier Providers *ProviderCollection }
func NewEmbeddedComponent ¶
func NewEmbeddedComponent(identifier Identifier) *EmbeddedComponent
type File ¶
type File struct { Source string Package string Imports []string Providers *ProviderCollection Components map[Identifier]*EmbeddedComponent }
File is the model of a parsed file. It contains the imports used within the original file as well as a slice of all direct providers defined within the file.
func (File) MergeProviders ¶
func (f File) MergeProviders() (*ProviderCollection, error)
type Identifier ¶
Identifier represents a dependency, including its name and type.
func DetermineIdentifier ¶ added in v2.0.2
func DetermineIdentifier(name string, typ ast.Expr) (Identifier, error)
func IdentifierFromField ¶
func IdentifierFromField(field *ast.Field) (Identifier, error)
func (Identifier) ErrorString ¶
func (i Identifier) ErrorString() string
func (Identifier) String ¶
func (i Identifier) String() string
type Provider ¶
type Provider struct { Identifier Package string IsSingleton bool IsComponent bool Requirements []Identifier }
Provider represents a function used to provide a dependency.
func (*Provider) WithRequirement ¶
type ProviderCollection ¶
type ProviderCollection struct {
// contains filtered or unexported fields
}
func FromProviders ¶
func FromProviders(providers []Provider) *ProviderCollection
func (*ProviderCollection) Add ¶
func (p *ProviderCollection) Add(provider Provider)
func (*ProviderCollection) ByIdentifier ¶
func (p *ProviderCollection) ByIdentifier(ident Identifier) Provider
func (*ProviderCollection) GetSortedIdentifiers ¶
func (p *ProviderCollection) GetSortedIdentifiers() []Identifier
func (*ProviderCollection) Slice ¶
func (p *ProviderCollection) Slice() []Provider
Click to show internal directories.
Click to hide internal directories.