bazel

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package bazel parses BUILD.bazel files to extract GAPIC configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRESTNumericEnums

func ParseRESTNumericEnums(path string) (map[string]bool, error)

ParseRESTNumericEnums reads a BUILD.bazel file and returns a map of languages where the rest_numeric_enums attribute is explicitly set to False.

func ParseReleaseLevel

func ParseReleaseLevel(path string) (map[string]string, error)

ParseReleaseLevel reads a BUILD.bazel file and extracts release_level configuration for all recognized language GAPIC rules.

func ParseTransports

func ParseTransports(path string) (map[string]string, error)

ParseTransports reads a BUILD.bazel file and extracts transport configuration for all recognized language GAPIC rules.

Types

type Config

type Config struct {
	// DIREGAPIC indicates whether DIREGAPIC (Discovery REST GAPICs) is used.
	DIREGAPIC bool

	// GAPICImportPath is the import path for the GAPIC library.
	GAPICImportPath string

	// GRPCServiceConfig is the gRPC service config JSON file.
	GRPCServiceConfig string

	// HasGAPIC indicates whether the GAPIC generator should be run.
	HasGAPIC bool

	// HasGoGRPC indicates whether go_grpc_library is used.
	//
	// TODO(https://github.com/googleapis/librarian/issues/1021): Remove this field once
	// the googleapis migration from go_proto_library to go_grpc_library is complete.
	HasGoGRPC bool

	// HasLegacyGRPC indicates whether go_proto_library uses the legacy gRPC compiler.
	HasLegacyGRPC bool

	// Metadata indicates whether gapic_metadata.json should be generated.
	Metadata bool

	// ReleaseLevel is the API maturity level (e.g., "beta", "ga").
	ReleaseLevel string

	// RESTNumericEnums indicates whether numeric enums are supported in REST clients.
	RESTNumericEnums bool

	// ServiceYAML is the service configuration file.
	ServiceYAML string

	// Transport specifies the transport protocol (e.g., "grpc", "rest", "grpc+rest").
	Transport string
}

Config holds configuration extracted from googleapis BUILD.bazel files.

func Parse

func Parse(path string) (*Config, error)

Parse reads a BUILD.bazel file and extracts configuration from Bazel rules.

Jump to

Keyboard shortcuts

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