Documentation
¶
Overview ¶
Package repometadata represents the data in .repo-metadata.json files, and the ability to create those files from other Librarian configuration.
Index ¶
Constants ¶
const (
// GAPICAutoLibraryType is the library_type to use for GAPIC libraries.
GAPICAutoLibraryType = "GAPIC_AUTO"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RepoMetadata ¶
type RepoMetadata struct {
// APIDescription is the description of the API.
APIDescription string `json:"api_description,omitempty"`
// APIID is the fully qualified API ID (e.g., "secretmanager.googleapis.com").
APIID string `json:"api_id,omitempty"`
// APIShortname is the short name of the API.
APIShortname string `json:"api_shortname,omitempty"`
// ClientDocumentation is the URL to the client library documentation.
ClientDocumentation string `json:"client_documentation,omitempty"`
// ClientLibraryType is the type of the client library (e.g. "generated").
// A Go specific field.
ClientLibraryType string `json:"client_library_type,omitempty"`
// DefaultVersion is the default API version (e.g., "v1", "v1beta1").
DefaultVersion string `json:"default_version,omitempty"`
// Description is a short description of the API.
// A Go specific field.
Description string `json:"description,omitempty"`
// DistributionName is the name of the library distribution package.
DistributionName string `json:"distribution_name,omitempty"`
// IssueTracker is the URL to the issue tracker.
IssueTracker string `json:"issue_tracker,omitempty"`
// Language is the programming language (e.g., "rust", "python", "go").
Language string `json:"language,omitempty"`
// LibraryType is the type of library (e.g., "GAPIC_AUTO").
LibraryType string `json:"library_type,omitempty"`
// Name is the API short name.
Name string `json:"name,omitempty"`
// NamePretty is the human-readable name of the API.
NamePretty string `json:"name_pretty,omitempty"`
// ProductDocumentation is the URL to the product documentation.
ProductDocumentation string `json:"product_documentation,omitempty"`
// ReleaseLevel is the release level (e.g., "stable", "preview").
ReleaseLevel string `json:"release_level,omitempty"`
// Repo is the repository name (e.g., "googleapis/google-cloud-rust").
Repo string `json:"repo,omitempty"`
}
RepoMetadata represents the .repo-metadata.json file structure.
func FromLibrary ¶ added in v0.8.2
func FromLibrary(cfg *config.Config, library *config.Library, googleapisDir string) (*RepoMetadata, error)
FromLibrary creates a RepoMetadata from a specific library in a configuration. It retrieves API information from the provided googleapisDir and constructs common metadata. This function populates the following fields: - APIDescription - APIID - APIShortName - DistributionName - IssueTracker - Language - Name - NamePretty - ProductDocumentation - ReleaseLevel - Repo
Any other fields required by the caller's language should be populated by the caller before writing to disk.
func Read ¶ added in v0.8.4
func Read(libraryOutputDir string) (*RepoMetadata, error)
Read reads the .repo-metadata.json file in the given directory and unmarshals it as a RepoMetadata.
func (*RepoMetadata) Write ¶ added in v0.8.4
func (metadata *RepoMetadata) Write(libraryOutputDir string) error
Write writes the given RepoMetadata into libraryOutputDir/.repo-metadata.json.