Documentation
¶
Overview ¶
Package message defines data types which the Librarian CLI and language containers exchange. There shouldn't be CLI-specific data type or language container-specific data types in this package. TODO(b/447404382): Move this package to the https://github.com/googleapis/librarian GitHub repository once the interface is finalized.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Path string `json:"path,omitempty"`
ServiceConfig string `json:"service_config,omitempty"`
}
API corresponds to a single API definition within a librarian request/response.
type Change ¶
type Change struct {
Type string `json:"type"`
Subject string `json:"subject"`
Body string `json:"body"`
PiperCLNumber string `json:"piper_cl_number"`
CommitHash string `json:"commit_hash"`
}
Change represents a single commit change for a library.
type Library ¶
type Library struct {
ID string `json:"id,omitempty"`
Version string `json:"version,omitempty"`
APIs []API `json:"apis,omitempty"`
// SourcePaths are the directories to which librarian contributes code.
// For Go, this is typically the Go module directory.
SourcePaths []string `json:"source_roots,omitempty"`
// PreserveRegex are files/directories to leave untouched during generation.
// This is useful for preserving handwritten helper files or customizations.
PreserveRegex []string `json:"preserve_regex,omitempty"`
// RemoveRegex are files/directories to remove during generation.
RemoveRegex []string `json:"remove_regex,omitempty"`
// Changes are the changes being released (in a release request)
Changes []*Change `json:"changes,omitempty"`
// Specifying a tag format allows librarian to honor this format when creating
// a tag for the release of the library. The replacement values of {id} and {version}
// permitted to reference the values configured in the library. If not specified
// the assumed format is {id}-{version}. e.g., {id}/v{version}.
TagFormat string `yaml:"tag_format,omitempty" json:"tag_format,omitempty"`
// ReleaseTriggered indicates whether this library is being released (in a release request)
ReleaseTriggered bool `json:"release_triggered,omitempty"`
}
Library is the combination of all the fields used by CLI requests and responses. Each CLI command has its own request/response type, but they all use Library.
func ParseLibrary ¶
ParseLibrary reads a file from the given path and unmarshals it into a Library struct. This is used for build and generate, where the requests are simply the library, with no wrapping.
type ReleaseStageRequest ¶
type ReleaseStageRequest struct {
Libraries []*Library `json:"libraries"`
}
ReleaseStageRequest is the structure of the release-stage-request.json file.
type ReleaseStageResponse ¶
type ReleaseStageResponse struct {
Error string `json:"error,omitempty"`
}
ReleaseStageResponse is the structure of the release-stage-response.json file.