Documentation
¶
Overview ¶
Package snippetmetadata provides cross-language functionality for working with metadata files associated with generated sample code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoClientLibraryField is the error returned if a snippet metadata file // has no clientLibrary field at the top level. ErrNoClientLibraryField = errors.New("no clientLibrary field at the top level") )
Functions ¶
func ReformatAll ¶
ReformatAll reformats all snippet metadata files (filenames starting with "snippet_metadata" and ending with ".json") under the given directory (including subdirectories).
func UpdateAllLibraryVersions ¶
UpdateAllLibraryVersions updates the clientLibrary.version field of all snippet metadata files (filenames starting with "snippet_metadata" and ending with ".json") under the given directory (including subdirectories).
Types ¶
type ClientLibrary ¶ added in v0.31.0
type ClientLibrary struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Language string `json:"language,omitempty"`
}
ClientLibrary represents the clientLibrary object inside snippet metadata.
type SnippetMetadata ¶ added in v0.31.0
type SnippetMetadata struct {
ClientLibrary ClientLibrary `json:"clientLibrary"`
}
SnippetMetadata represents the top-level structure of a snippet metadata file.