protostat

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 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 {
	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 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