serviceconfig

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package serviceconfig reads and parses API service config files.

Index

Constants

This section is empty.

Variables

View Source
var APIs = []API{}/* 388 elements not displayed */

APIs defines all API paths and their language availability.

Functions

This section is empty.

Types

type API

type API struct {
	// Path is the proto directory path in github.com/googleapis/googleapis.
	// If ServiceConfig is empty, the service config is assumed to live at this path.
	Path string

	// Languages restricts which languages can generate client libraries for this API.
	// Empty means all languages can use this API.
	//
	// Restrictions exist for several reasons:
	//   - Newer languages (Rust, Dart) skip older beta versions when stable versions exist
	//   - Python has historical legacy APIs not available to other languages
	//   - Some APIs (like DIREGAPIC protos) are only used by specific languages
	Languages []string

	// Discovery is the file path to a discovery document in
	// github.com/googleapis/discovery-artifact-manager.
	// Used by sidekick languages (Rust, Dart) as an alternative to proto files.
	Discovery string

	// OpenAPI is the file path to an OpenAPI spec, currently in internal/testdata.
	// This is not an official spec yet and exists only for Rust to validate OpenAPI support.
	OpenAPI string

	// ServiceConfig is the service config file path override.
	// If empty, the service config is discovered in the directory specified by Path.
	ServiceConfig string

	// Title overrides the API title from the service config.
	Title string
}

API describes an API path and its availability across languages.

func Find

func Find(googleapisDir, path string) (*API, error)

Find looks up the service config path and title override for a given API path. It first checks the API allowlist for overrides, then searches for YAML files containing "type: google.api.Service", skipping any files ending in _gapic.yaml.

The path should be relative to googleapisDir (e.g., "google/cloud/secretmanager/v1"). Returns an API struct with Path, ServiceConfig, and Title fields populated. ServiceConfig and Title may be empty strings if not found or not configured.

type Authentication

type Authentication = serviceconfig.Authentication

Type aliases for genproto service config types.

type AuthenticationRule

type AuthenticationRule = serviceconfig.AuthenticationRule

Type aliases for genproto service config types.

type Backend

type Backend = serviceconfig.Backend

Type aliases for genproto service config types.

type BackendRule

type BackendRule = serviceconfig.BackendRule

Type aliases for genproto service config types.

type Documentation

type Documentation = serviceconfig.Documentation

Type aliases for genproto service config types.

type DocumentationRule

type DocumentationRule = serviceconfig.DocumentationRule

Type aliases for genproto service config types.

type OAuthRequirements

type OAuthRequirements = serviceconfig.OAuthRequirements

Type aliases for genproto service config types.

type Service

type Service = serviceconfig.Service

Type aliases for genproto service config types.

func Read

func Read(serviceConfigPath string) (*Service, error)

Read reads a service config from a YAML file and returns it as a Service proto. The file is parsed as YAML, converted to JSON, and then unmarshaled into a Service proto.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL