protostat

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWalker

type FileWalker interface {
	// Walk will invoke f for all .proto files for GetStats.
	Walk(ctx context.Context, f func(io.Reader) error) error
}

FileWalker goes through all .proto files for GetStats.

type Stats

type Stats struct {
	Files                 int `json:"files" yaml:"files"`
	Types                 int `json:"types" yaml:"types"`
	Packages              int `json:"packages" yaml:"packages"`
	Messages              int `json:"messages" yaml:"messages"`
	Fields                int `json:"fields" yaml:"fields"`
	Enums                 int `json:"enums" yaml:"enums"`
	EnumValues            int `json:"evalues" yaml:"evalues"`
	Services              int `json:"services" yaml:"services"`
	RPCs                  int `json:"rpcs" yaml:"rpcs"`
	Extensions            int `json:"extensions" yaml:"extensions"`
	FilesWithSyntaxErrors int `json:"-" yaml:"-"`
}

Stats represents some statistics about one or more Protobuf files.

Note that as opposed to most structs in this codebase, we do not omitempty for the fields for JSON or YAML.

func GetStats

func GetStats(ctx context.Context, fileWalker FileWalker) (*Stats, error)

GetStats gathers some simple statistics about a set of Protobuf files.

See the packages protostatos and protostatstorage for helpers for the os and storage packages.

func MergeStats added in v1.16.0

func MergeStats(statsSlice ...*Stats) *Stats

MergeStats merged multiple stats objects into one single Stats object.

A new object is returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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