Documentation ¶
Index ¶
- Variables
- func RenderGraph(g GraphBuilder, page *GraphPage) error
- type CryptoScapeAVSDFGraphBuilder
- type CryptoScapeAVSDFGraphBuilderData
- type CryptoScapeAVSDFGraphBuilderElements
- type CryptoScapeAVSDFGraphBuilderNode
- type CryptoScrapeAVSDFGraphBuilderEdge
- type DraculaGraphBuilder
- type GraphBuilder
- type GraphEdge
- type GraphPage
Constants ¶
This section is empty.
Variables ¶
View Source
var CMD = &cobra.Command{ Use: "dependgraph", Long: "visualization dependendency graph output", Short: "visualization dependendency graph output", Run: func(cmd *cobra.Command, args []string) { g := make(dependgraph) for _, f := range args { err := g.ReadFile(f) if err != nil { panic(err) } } tmpFile, err := ioutil.TempDir("", "dependgraph-*.html") if err != nil { panic(err) } if err != nil { panic(err) } var graph GraphBuilder switch viper.GetString("graph") { case "avsd": graph = NewCryptoScapeAVSDFGraphBuilder() case "dracula": graph = NewDraculaGraph() default: panic(fmt.Sprintf("invalid error mode '%s'", viper.GetString("graph"))) } err = RenderGraph(graph, &GraphPage{ Edges: g.Edges(), }) if err != nil { panic(err) } path := filepath.Join(tmpFile, "dependgraph.html") err = graph.Write(path) if err != nil { panic(err) } didStart := startBrowser(fmt.Sprintf("file://%s", path)) if !didStart { fmt.Printf("visit this link to view the graph file://%s", path) } }, }
Functions ¶
func RenderGraph ¶
func RenderGraph(g GraphBuilder, page *GraphPage) error
Types ¶
type CryptoScapeAVSDFGraphBuilder ¶
type CryptoScapeAVSDFGraphBuilder struct {
// contains filtered or unexported fields
}
func NewCryptoScapeAVSDFGraphBuilder ¶
func NewCryptoScapeAVSDFGraphBuilder() *CryptoScapeAVSDFGraphBuilder
func (*CryptoScapeAVSDFGraphBuilder) Dependencies ¶
func (s *CryptoScapeAVSDFGraphBuilder) Dependencies() error
func (*CryptoScapeAVSDFGraphBuilder) Graph ¶
func (s *CryptoScapeAVSDFGraphBuilder) Graph(page *GraphPage) error
func (*CryptoScapeAVSDFGraphBuilder) Renderer ¶
func (s *CryptoScapeAVSDFGraphBuilder) Renderer() error
func (*CryptoScapeAVSDFGraphBuilder) Write ¶
func (s *CryptoScapeAVSDFGraphBuilder) Write(path string) error
type CryptoScapeAVSDFGraphBuilderData ¶
type CryptoScapeAVSDFGraphBuilderData[T any] struct { Data T `json:"data"` }
type CryptoScapeAVSDFGraphBuilderElements ¶
type CryptoScapeAVSDFGraphBuilderElements struct { Edges []CryptoScapeAVSDFGraphBuilderData[CryptoScrapeAVSDFGraphBuilderEdge] `json:"edges"` Nodes []CryptoScapeAVSDFGraphBuilderData[CryptoScapeAVSDFGraphBuilderNode] `json:"nodes"` }
type CryptoScapeAVSDFGraphBuilderNode ¶
type CryptoScapeAVSDFGraphBuilderNode struct {
ID string `json:"id"`
}
type DraculaGraphBuilder ¶
type DraculaGraphBuilder struct {
// contains filtered or unexported fields
}
func (*DraculaGraphBuilder) Dependencies ¶
func (g *DraculaGraphBuilder) Dependencies() error
func (*DraculaGraphBuilder) Graph ¶
func (g *DraculaGraphBuilder) Graph(page *GraphPage) error
func (*DraculaGraphBuilder) Renderer ¶
func (g *DraculaGraphBuilder) Renderer() error
func (*DraculaGraphBuilder) Write ¶
func (g *DraculaGraphBuilder) Write(path string) error
type GraphBuilder ¶
type GraphBuilder interface { Graph(edges *GraphPage) error Write(string) error Renderer() error Dependencies() error }
func NewDraculaGraph ¶
func NewDraculaGraph() GraphBuilder
Click to show internal directories.
Click to hide internal directories.