component

package
v0.0.0-...-c1e63d8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Slash = "/"

Variables

This section is empty.

Functions

func NewNamespaceColorMap

func NewNamespaceColorMap(values map[string]string) map[Namespace]Color

Types

type Color

type Color string

func NewColor

func NewColor(value string) Color

func (Color) String

func (c Color) String() string

type Component

type Component struct {
	// contains filtered or unexported fields
}

func New

func New(namespace Namespace) *Component

func (*Component) AddBytesInSize

func (c *Component) AddBytesInSize(bytes int)

func (*Component) Color

func (c *Component) Color() Color

func (*Component) Colorize

func (c *Component) Colorize(color Color)

func (*Component) ExtendID

func (c *Component) ExtendID()

func (*Component) HasColor

func (c *Component) HasColor() bool

func (*Component) ID

func (c *Component) ID() string

func (*Component) IsSizeNormalized

func (c *Component) IsSizeNormalized() bool

func (*Component) IsThirdParty

func (c *Component) IsThirdParty() bool

func (*Component) Namespace

func (c *Component) Namespace() Namespace

func (*Component) NormalizeSize

func (c *Component) NormalizeSize(normalizedSize float64)

func (*Component) NormalizedSize

func (c *Component) NormalizedSize() float64

func (*Component) SetStability

func (c *Component) SetStability(stability float64)

func (*Component) SizeBytes

func (c *Component) SizeBytes() int

func (*Component) Stability

func (c *Component) Stability() float64

func (*Component) UseNamespaceAsID

func (c *Component) UseNamespaceAsID()

type Components

type Components []*Component

func (Components) OrderByStability

func (components Components) OrderByStability() Components

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

func ApplyGraphConfig

func ApplyGraphConfig(conf *GraphConfig, componentGraph *Graph) (*Graph, error)

func NewGraph

func NewGraph(imports Imports) *Graph

func (*Graph) CalculateStability

func (g *Graph) CalculateStability()

func (*Graph) Colorize

func (g *Graph) Colorize(namespaceColorMap map[Namespace]Color)

func (*Graph) ColorizeThirdParty

func (g *Graph) ColorizeThirdParty(color Color)

func (*Graph) Components

func (g *Graph) Components() Components

func (*Graph) CreateCustomComponents

func (g *Graph) CreateCustomComponents(namespaces Namespaces) *Graph

func (*Graph) ExcludeChildComponents

func (g *Graph) ExcludeChildComponents(namespaces Namespaces) *Graph

func (*Graph) ExcludeParentComponents

func (g *Graph) ExcludeParentComponents(namespaces Namespaces) *Graph

func (*Graph) ExtendComponentIDs

func (g *Graph) ExtendComponentIDs(idRegexpPatternAndSections map[string]int) error

func (*Graph) Imports

func (g *Graph) Imports() Imports

func (*Graph) IncludeChildComponents

func (g *Graph) IncludeChildComponents(namespaces Namespaces) *Graph

func (*Graph) IncludeOnlyComponents

func (g *Graph) IncludeOnlyComponents(namespaces Namespaces) *Graph

func (*Graph) IncludeParentAndChildComponents

func (g *Graph) IncludeParentAndChildComponents(
	parentComponentNamespaces Namespaces,
	childComponentNamespaces Namespaces,
) *Graph

func (*Graph) IncludeParentComponents

func (g *Graph) IncludeParentComponents(namespaces Namespaces) *Graph

func (*Graph) MakeUniqueComponentIDs

func (g *Graph) MakeUniqueComponentIDs()

func (*Graph) NormalizeComponentSizes

func (g *Graph) NormalizeComponentSizes()

func (*Graph) RemoveThirdPartyComponents

func (g *Graph) RemoveThirdPartyComponents() *Graph

func (*Graph) String

func (g *Graph) String() string

type GraphConfig

type GraphConfig struct {
	ExtendComponentIDs          map[string]int
	IncludeThirdPartyComponents bool
	ThirdPartyComponentsColor   Color
	IncludeParentComponents     Namespaces
	IncludeChildComponents      Namespaces
	ExcludeParentComponents     Namespaces
	ExcludeChildComponents      Namespaces
	CustomComponents            Namespaces
	OnlyComponents              Namespaces
	ComponentColors             map[Namespace]Color
	EnableComponentSize         bool
}

type Import

type Import struct {
	// contains filtered or unexported fields
}

func NewImport

func NewImport(from, to *Component) *Import

func (*Import) From

func (i *Import) From() *Component

func (*Import) String

func (i *Import) String() string

func (*Import) To

func (i *Import) To() *Component

type Imports

type Imports []*Import

type Namespace

type Namespace string

func NewNamespace

func NewNamespace(value string) Namespace

func (Namespace) Contains

func (ns Namespace) Contains(another Namespace) bool

func (Namespace) ExtendComponentID

func (ns Namespace) ExtendComponentID(componentIDSections string) string

func (Namespace) HasPrefix

func (ns Namespace) HasPrefix(prefix string) bool

func (Namespace) LastSection

func (ns Namespace) LastSection() string

func (Namespace) String

func (ns Namespace) String() string

func (Namespace) TrimPrefix

func (ns Namespace) TrimPrefix(prefix string) Namespace

type Namespaces

type Namespaces []Namespace

func NewNamespaces

func NewNamespaces(values []string) Namespaces

Jump to

Keyboard shortcuts

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