dependency

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package dependency provides functions to create the Dependency Graph for a Golang project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleDependencyGraph

type ModuleDependencyGraph struct {
	Module       string              `json:"module"`       // module package
	Internal     []string            `json:"internal"`     // Internal dependencies
	External     []string            `json:"external"`     // External dependencies
	Organization []string            `json:"organization"` // dependencies maintained by the same organization
	StandardLib  []string            `json:"standard"`     // dependencies from standard golang library
	Relations    map[string][]string `json:"relations"`    // each key correspond to an internal package and the value stores the imported packages for this package
}

ModuleDependencyGraph represents a Dependency Graph for a Golang Module

func GetDependencyGraph

func GetDependencyGraph(prj *project.ProjectInfo, startPackage string) (*ModuleDependencyGraph, error)

GetDependencyGraph retrieves a structure that represents a Dependency Graph for the provided Golang project If you pass a startPackage different from "ALL", then this function will generate the Dependency Graph starting at this package and including only the referenced packages.

An error is returned when it's not possible to get the packages information

Jump to

Keyboard shortcuts

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