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
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.