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
MergeStats merged multiple stats objects into one single Stats object.
A new object is returned.
Click to show internal directories.
Click to hide internal directories.