protostat

package
v0.0.0-...-a078c60 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 {
	NumFiles                 int `json:"num_files" yaml:"num_files"`
	NumPackages              int `json:"num_packages" yaml:"num_packages"`
	NumFilesWithSyntaxErrors int `json:"num_files_with_syntax_errors" yaml:"num_files_with_syntax_errors"`
	NumMessages              int `json:"num_messages" yaml:"num_messages"`
	NumFields                int `json:"num_fields" yaml:"num_fields"`
	NumEnums                 int `json:"num_enums" yaml:"num_enums"`
	NumEnumValues            int `json:"num_enum_values" yaml:"num_enum_values"`
	NumExtensions            int `json:"num_extensions" yaml:"num_extensions"`
	NumServices              int `json:"num_services" yaml:"num_services"`
	NumMethods               int `json:"num_methods" yaml:"num_methods"`
}

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

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