{"modulePath":"github.com/github/git-sizer","version":"v1.6.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sizes\n\n## Functions\n\n```go\nfunc NewThresholdFlagValue(threshold *Threshold, value Threshold) pflag.Value\n```\n\n## Types\n\n```go\ntype BlobSize struct {\n\tSize counts.Count32\n}\n```\n\n```go\nfunc (s BlobSize) String() string\n```\n\n```go\ntype CommitSize struct {\n\t// The height of the ancestor graph, including this commit.\n\tMaxAncestorDepth counts.Count32 `json:\"max_ancestor_depth\"`\n}\n```\n\n```go\nfunc (s CommitSize) String() string\n```\n\n```go\ntype ExplicitRoot struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewExplicitRoot(name string, oid git.OID) ExplicitRoot\n```\n\n```go\nfunc (er ExplicitRoot) Name() string\n```\n\n```go\nfunc (er ExplicitRoot) OID() git.OID\n```\n\n```go\nfunc (er ExplicitRoot) Walk() bool\n```\n\n```go\ntype Footnotes struct {\n\t// contains filtered or unexported fields\n}\n```\nFootnotes collects and numbers footnotes for a \\`table\\`.\n\n```go\nfunc NewFootnotes() *Footnotes\n```\nNewFootnotes creates and returns a new \\`Footnotes\\` instance.\n\n```go\nfunc (f *Footnotes) CreateCitation(footnote string) string\n```\nCreateCitation adds a footnote with the specified text and returns the string that should be used to refer to it (e.g., \"\\[2]\"). If there is already a footnote with the exact same text, reuse its number.\n\n```go\nfunc (f *Footnotes) String() string\n```\nString returns a string representation of the footnote, including a trailing LF.\n\n```go\ntype Graph struct {\n\t// contains filtered or unexported fields\n}\n```\nGraph is an object graph that is being built up.\n\n```go\nfunc NewGraph(nameStyle NameStyle) *Graph\n```\nNewGraph creates and returns a new \\`\\*Graph\\` instance.\n\n```go\nfunc (g *Graph) GetBlobSize(oid git.OID) BlobSize\n```\n\n```go\nfunc (g *Graph) GetCommitSize(oid git.OID) CommitSize\n```\n\n```go\nfunc (g *Graph) GetTreeSize(oid git.OID) TreeSize\n```\n\n```go\nfunc (g *Graph) HistorySize() HistorySize\n```\nHistorySize returns the size data that have been collected.\n\n```go\nfunc (g *Graph) RegisterBlob(oid git.OID, objectSize counts.Count32)\n```\nRegisterBlob records that the specified \\`oid\\` is a blob with the specified size.\n\n```go\nfunc (g *Graph) RegisterCommit(oid git.OID, commit *git.Commit)\n```\nRecord that the specified \\`oid\\` is the specified \\`commit\\`.\n\n```go\nfunc (g *Graph) RegisterName(name string, oid git.OID)\n```\nRegister a name that can be used for the specified OID.\n\n```go\nfunc (g *Graph) RegisterReference(ref git.Reference, groups []RefGroupSymbol)\n```\nRegisterReference records the specified reference in \\`g\\`.\n\n```go\nfunc (g *Graph) RegisterTag(oid git.OID, tag *git.Tag)\n```\nRecord that the specified \\`oid\\` is the specified \\`tag\\`.\n\n```go\nfunc (g *Graph) RegisterTree(oid git.OID, tree *git.Tree) error\n```\nRecord that the specified \\`oid\\` is the specified \\`tree\\`.\n\n```go\nfunc (g *Graph) RequireTagSize(oid git.OID, listener func(TagSize)) (TagSize, bool)\n```\n\n```go\nfunc (g *Graph) RequireTreeSize(oid git.OID, listener func(TreeSize)) (TreeSize, bool)\n```\n\n```go\ntype HistorySize struct {\n\t// The total number of unique commits analyzed.\n\tUniqueCommitCount counts.Count32 `json:\"unique_commit_count\"`\n\n\t// The total size of all commits analyzed.\n\tUniqueCommitSize counts.Count64 `json:\"unique_commit_size\"`\n\n\t// The maximum size of any analyzed commit.\n\tMaxCommitSize counts.Count32 `json:\"max_commit_size\"`\n\n\t// The commit with the maximum size.\n\tMaxCommitSizeCommit *Path `json:\"max_commit,omitempty\"`\n\n\t// The maximum ancestor depth of any analyzed commit.\n\tMaxHistoryDepth counts.Count32 `json:\"max_history_depth\"`\n\n\t// The maximum number of direct parents of any analyzed commit.\n\tMaxParentCount counts.Count32 `json:\"max_parent_count\"`\n\n\t// The commit with the maximum number of direct parents.\n\tMaxParentCountCommit *Path `json:\"max_parent_count_commit,omitempty\"`\n\n\t// The total number of unique trees analyzed.\n\tUniqueTreeCount counts.Count32 `json:\"unique_tree_count\"`\n\n\t// The total size of all trees analyzed.\n\tUniqueTreeSize counts.Count64 `json:\"unique_tree_size\"`\n\n\t// The total number of tree entries in all unique trees analyzed.\n\tUniqueTreeEntries counts.Count64 `json:\"unique_tree_entries\"`\n\n\t// The maximum number of entries an a tree.\n\tMaxTreeEntries counts.Count32 `json:\"max_tree_entries\"`\n\n\t// The tree with the maximum number of entries.\n\tMaxTreeEntriesTree *Path `json:\"max_tree_entries_tree,omitempty\"`\n\n\t// The total number of unique blobs analyzed.\n\tUniqueBlobCount counts.Count32 `json:\"unique_blob_count\"`\n\n\t// The total size of all of the unique blobs analyzed.\n\tUniqueBlobSize counts.Count64 `json:\"unique_blob_size\"`\n\n\t// The maximum size of any analyzed blob.\n\tMaxBlobSize counts.Count32 `json:\"max_blob_size\"`\n\n\t// The biggest blob found.\n\tMaxBlobSizeBlob *Path `json:\"max_blob_size_blob,omitempty\"`\n\n\t// The total number of unique tag objects analyzed.\n\tUniqueTagCount counts.Count32 `json:\"unique_tag_count\"`\n\n\t// The maximum number of tags in a chain.\n\tMaxTagDepth counts.Count32 `json:\"max_tag_depth\"`\n\n\t// The tag with the maximum tag depth.\n\tMaxTagDepthTag *Path `json:\"max_tag_depth_tag,omitempty\"`\n\n\t// The number of references analyzed. Note that we don't eliminate\n\t// duplicates if the user passes the same reference more than\n\t// once.\n\tReferenceCount counts.Count32 `json:\"reference_count\"`\n\n\t// ReferenceGroups keeps track of how many references in each\n\t// reference group were scanned.\n\tReferenceGroups map[RefGroupSymbol]*counts.Count32 `json:\"reference_groups\"`\n\n\t// The maximum depth of trees and blobs starting at this object\n\t// (not including this object).\n\tMaxPathDepth counts.Count32 `json:\"max_path_depth\"`\n\n\t// The tree with the maximum path depth.\n\tMaxPathDepthTree *Path `json:\"max_path_depth_tree,omitempty\"`\n\n\t// The maximum length of any path relative to this object, in\n\t// characters.\n\tMaxPathLength counts.Count32 `json:\"max_path_length\"`\n\n\t// The tree with the maximum path length.\n\tMaxPathLengthTree *Path `json:\"max_path_length_tree,omitempty\"`\n\n\t// The total number of trees, including duplicates.\n\tMaxExpandedTreeCount counts.Count32 `json:\"max_expanded_tree_count\"`\n\n\t// The tree with the maximum expanded tree count.\n\tMaxExpandedTreeCountTree *Path `json:\"max_expanded_tree_count_tree,omitempty\"`\n\n\t// The total number of blobs, including duplicates.\n\tMaxExpandedBlobCount counts.Count32 `json:\"max_expanded_blob_count\"`\n\n\t// The tree with the maximum expanded blob count.\n\tMaxExpandedBlobCountTree *Path `json:\"max_expanded_blob_count_tree,omitempty\"`\n\n\t// The total size of all blobs, including duplicates.\n\tMaxExpandedBlobSize counts.Count64 `json:\"max_expanded_blob_size\"`\n\n\t// The tree with the maximum expanded blob size.\n\tMaxExpandedBlobSizeTree *Path `json:\"max_expanded_blob_size_tree,omitempty\"`\n\n\t// The total number of symbolic links, including duplicates.\n\tMaxExpandedLinkCount counts.Count32 `json:\"max_expanded_link_count\"`\n\n\t// The tree with the maximum expanded link count.\n\tMaxExpandedLinkCountTree *Path `json:\"max_expanded_link_count_tree,omitempty\"`\n\n\t// The total number of submodules referenced, including duplicates.\n\tMaxExpandedSubmoduleCount counts.Count32 `json:\"max_expanded_submodule_count\"`\n\n\t// The tree with the maximum expanded submodule count.\n\tMaxExpandedSubmoduleCountTree *Path `json:\"max_expanded_submodule_count_tree,omitempty\"`\n}\n```\n\n```go\nfunc ScanRepositoryUsingGraph(\n\tctx context.Context,\n\trepo *git.Repository,\n\troots []Root,\n\tnameStyle NameStyle,\n\tprogressMeter meter.Progress,\n) (HistorySize, error)\n```\nScanRepositoryUsingGraph scans \\`repo\\`, using \\`rg\\` to decide which references to scan and how to group them. \\`nameStyle\\` specifies whether the output should include full names, hashes only, or nothing in the footnotes. \\`progress\\` tells whether a progress meter should be displayed while it works.\n\nIt returns the size data for the repository.\n\n```go\nfunc (s *HistorySize) JSON(\n\trefGroups []RefGroup, threshold Threshold, nameStyle NameStyle,\n) ([]byte, error)\n```\n\n```go\nfunc (s *HistorySize) String() string\n```\n\n```go\nfunc (s *HistorySize) TableString(\n\trefGroups []RefGroup, threshold Threshold, nameStyle NameStyle,\n) string\n```\n\n```go\ntype InOrderPathResolver struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (pr *InOrderPathResolver) ForgetPath(p *Path)\n```\nRecord that the specified path is wanted by one less seeker. If its seeker count goes to zero, remove it from \\`pr.soughtPaths\\`.\n\n```go\nfunc (pr *InOrderPathResolver) RecordCommit(oid, tree git.OID)\n```\n\n```go\nfunc (pr *InOrderPathResolver) RecordName(name string, oid git.OID)\n```\n\n```go\nfunc (pr *InOrderPathResolver) RecordTag(oid git.OID, tag *git.Tag)\n```\n\n```go\nfunc (pr *InOrderPathResolver) RecordTreeEntry(oid git.OID, name string, childOID git.OID)\n```\nRecord that the tree with OID \\`oid\\` has an entry with the specified \\`name\\` and \\`childOID\\`.\n\n```go\nfunc (pr *InOrderPathResolver) RequestPath(oid git.OID, objectType string) *Path\n```\nRequest that a path to the object named \\`oid\\` be computed.\n\n```go\ntype NameStyle int\n```\n\n```go\nconst (\n\tNameStyleNone NameStyle = iota\n\tNameStyleHash\n\tNameStyleFull\n)\n```\n\n```go\nfunc (n *NameStyle) Set(s string) error\n```\n\n```go\nfunc (n *NameStyle) String() string\n```\n\n```go\nfunc (n *NameStyle) Type() string\n```\n\n```go\ntype NullPathResolver struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (_ NullPathResolver) ForgetPath(p *Path)\n```\n\n```go\nfunc (_ NullPathResolver) RecordCommit(oid, tree git.OID)\n```\n\n```go\nfunc (_ NullPathResolver) RecordName(name string, oid git.OID)\n```\n\n```go\nfunc (_ NullPathResolver) RecordTag(oid git.OID, tag *git.Tag)\n```\n\n```go\nfunc (_ NullPathResolver) RecordTreeEntry(oid git.OID, name string, childOID git.OID)\n```\n\n```go\nfunc (n NullPathResolver) RequestPath(oid git.OID, objectType string) *Path\n```\n\n```go\ntype Path struct {\n\t// The OID of the object whose path we seek. This member is always\n\t// set.\n\tgit.OID\n\t// contains filtered or unexported fields\n}\n```\nStructure for keeping track of an object whose path we want to know (e.g., the biggest blob, or a tree containing the biggest blob, or a commit whose tree contains the biggest blob). Valid states:\n\n  - \\`parent == nil \u0026\u0026 relativePath == \"\"\\`—we have not yet found anything that refers to this object.\n\n  - \\`parent != nil \u0026\u0026 relativePath == \"\"\\`—this object is a tree, and we have found a commit that refers to it.\n\n  - \\`parent == nil \u0026\u0026 relativePath != \"\"\\`—we have found a reference that points directly at this object; \\`relativePath\\` is the full name of the reference.\n\n  - \\`parent != nil \u0026\u0026 relativePath != \"\"\\`—this object is a blob or tree, and we have found another tree that refers to it; \\`relativePath\\` is the corresponding tree entry name.\n\n```go\nfunc (p *Path) BestPath() string\n```\nReturn some human-readable path for this object, even if it's just the OID.\n\n```go\nfunc (p *Path) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (p *Path) Path() string\n```\nReturn a human-readable path for this object if we can do better than its OID; otherwise, return \"\".\n\n```go\nfunc (p *Path) String() string\n```\n\n```go\nfunc (p *Path) TreePrefix() string\n```\nReturn the path of this object under the assumption that another path component will be appended to it.\n\n```go\ntype PathResolver interface {\n\tRequestPath(oid git.OID, objectType string) *Path\n\tForgetPath(p *Path)\n\tRecordName(name string, oid git.OID)\n\tRecordTreeEntry(oid git.OID, name string, childOID git.OID)\n\tRecordCommit(oid, tree git.OID)\n\tRecordTag(oid git.OID, tag *git.Tag)\n}\n```\nPathResolver figures out a \"reachability path\" (i.e., Git \\`rev-parse\\` input, including commit and/or file path) by which specified objects are reachable. It is used as follows:\n\n  - Request an object's path using \\`RequestPath()\\`. The returned \\`Path\\` object is a placeholder for the object's path.\n\n  - Tell the \\`PathResolver\\` about objects that might be along the object's reachability path, \\*in depth-first\\* order (i.e., referents before referers) by calling \\`RecordTree()\\`, \\`RecordCommit()\\`, \\`RecordTag()\\`, and \\`RecordReference()\\`,.\n\n  - Read the path out of the \\`Path\\` object using \\`Path.Path()\\`.\n\nMultiple objects can be processed at once.\n\nIt is important that interested is registered in an object's path via \\`RequestPath()\\` \\*before\\* any of the objects along its reachability path are recorded.\n\nIf a caller decides that it is not interested in a path after all, it can call \\`ForgetPath()\\`. This might free up some resources that would otherwise continue consuming memory.\n\n```go\nfunc NewPathResolver(nameStyle NameStyle) PathResolver\n```\n\n```go\ntype RefGroup struct {\n\t// Symbol is the unique string by which this `RefGroup` is\n\t// identified and configured. It consists of dot-separated\n\t// components, which implicitly makes a nested tree-like\n\t// structure.\n\tSymbol RefGroupSymbol\n\n\t// Name is the name for this `ReferenceGroup` to be presented\n\t// in user-readable output.\n\tName string\n}\n```\nRefGroup is a group of references, for example \"branches\" or \"tags\". Reference groups might overlap.\n\n```go\ntype RefGroupSymbol string\n```\nRefGroupSymbol is the string \"identifier\" that is used to refer to a refgroup, for example in the gitconfig. Nesting of refgroups is inferred from their names, using \".\" as separator between components. For example, if there are three refgroups with symbols \"tags\", \"tags.releases\", and \"foo.bar\", then \"tags.releases\" is considered to be nested within \"tags\", and \"foo.bar\" is considered to be nested within \"foo\", the latter being created automatically if it was not configured explicitly.\n\n```go\ntype RefGrouper interface {\n\t// Categorize tells whether `refname` should be walked at all,\n\t// and if so, the symbols of the reference groups to which it\n\t// belongs.\n\tCategorize(refname string) (bool, []RefGroupSymbol)\n\n\t// Groups returns the list of `ReferenceGroup`s, in the order\n\t// that they should be presented. The return value might\n\t// depend on which references have been seen so far.\n\tGroups() []RefGroup\n}\n```\nRefGrouper describes a type that can collate reference names into groups and decide which ones to walk.\n\n```go\ntype RefRoot struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc CollectReferences(\n\tctx context.Context, repo *git.Repository, rg RefGrouper,\n) ([]RefRoot, error)\n```\n\n```go\nfunc (rr RefRoot) Groups() []RefGroupSymbol\n```\n\n```go\nfunc (rr RefRoot) Name() string\n```\n\n```go\nfunc (rr RefRoot) OID() git.OID\n```\n\n```go\nfunc (rr RefRoot) Reference() git.Reference\n```\n\n```go\nfunc (rr RefRoot) Walk() bool\n```\n\n```go\ntype ReferenceRoot interface {\n\tRoot\n\tReference() git.Reference\n\tGroups() []RefGroupSymbol\n}\n```\n\n```go\ntype Root interface {\n\tName() string\n\tOID() git.OID\n\tWalk() bool\n}\n```\n\n```go\ntype Size interface {\n\tfmt.Stringer\n}\n```\n\n```go\ntype TagSize struct {\n\t// The number of tags that have to be traversed (including this\n\t// one) to get to an object.\n\tTagDepth counts.Count32\n}\n```\n\n```go\nfunc (s TagSize) String() string\n```\n\n```go\ntype Threshold float64\n```\n\n```go\nfunc (t *Threshold) Set(s string) error\n```\n\n```go\nfunc (t *Threshold) String() string\n```\n\n```go\nfunc (t *Threshold) Type() string\n```\n\n```go\ntype TreeSize struct {\n\t// The maximum depth of trees and blobs starting at this object\n\t// (not including this object).\n\tMaxPathDepth counts.Count32 `json:\"max_path_depth\"`\n\n\t// The maximum length of any path relative to this object, in\n\t// characters.\n\tMaxPathLength counts.Count32 `json:\"max_path_length\"`\n\n\t// The total number of trees, including duplicates.\n\tExpandedTreeCount counts.Count32 `json:\"expanded_tree_count\"`\n\n\t// The total number of blobs, including duplicates.\n\tExpandedBlobCount counts.Count32 `json:\"expanded_blob_count\"`\n\n\t// The total size of all blobs, including duplicates.\n\tExpandedBlobSize counts.Count64 `json:\"expanded_blob_size\"`\n\n\t// The total number of symbolic links, including duplicates.\n\tExpandedLinkCount counts.Count32 `json:\"expanded_link_count\"`\n\n\t// The total number of submodules referenced, including duplicates.\n\tExpandedSubmoduleCount counts.Count32 `json:\"expanded_submodule_count\"`\n}\n```\n\n```go\nfunc (s TreeSize) String() string\n```\n\n","path":"github.com/github/git-sizer/sizes","name":"sizes","synopsis":"","isRedistributable":true}
