structure

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

structure/entry.go

structure/tree.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeStats

type CodeStats struct {
	Code     int64
	Comments int64
	Blanks   int64
}

func (*CodeStats) Add

func (cs *CodeStats) Add(other CodeStats)

func (CodeStats) Total

func (cs CodeStats) Total() int64

type Entry

type Entry struct {
	Path  string
	Child []*Entry

	IsDir       bool
	StatsByLang map[string]CodeStats
	TotalStats  CodeStats
	// contains filtered or unexported fields
}

func NewDirEntry

func NewDirEntry(path string) *Entry

func NewFileEntry

func NewFileEntry(path string, stats map[string]CodeStats) *Entry

func (*Entry) AddChild

func (e *Entry) AddChild(child *Entry)

func (*Entry) AggregateStats

func (e *Entry) AggregateStats()

AggregateStats recursively updates directory statistics from child nodes

func (*Entry) Ext

func (e *Entry) Ext() string

func (*Entry) GetChild

func (e *Entry) GetChild(name string) *Entry

func (*Entry) GetStats

func (e *Entry) GetStats(langFilter string) CodeStats

func (*Entry) HasChild

func (e *Entry) HasChild() bool

func (*Entry) Languages

func (e *Entry) Languages() []string

func (*Entry) Name

func (e *Entry) Name() string

func (*Entry) SortChild

func (e *Entry) SortChild() *Entry

type Tree

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

func NewTree

func NewTree(root *Entry) *Tree

func (*Tree) BuildFromStdin

func (t *Tree) BuildFromStdin() error

func (*Tree) BuildFromTokei

func (t *Tree) BuildFromTokei(path string) error

BuildFromTokei builds the file tree from tokei's output for the given path

func (*Tree) Root

func (t *Tree) Root() *Entry

func (*Tree) SetRoot

func (t *Tree) SetRoot(root *Entry)

Jump to

Keyboard shortcuts

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