Help us shape the future of Go! Take the 2026 Go Developer Survey

discovery

package
v0.45.0 Latest Latest
Warning

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

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

Documentation

Overview

Package discovery parses Google Discovery Documents into the sidekick abstract API model (`api.API`).

Index

Constants

View Source
const (
	// SimpleKind is the category for any JSON Schema that maps to a
	// primitive Go type: strings, numbers, booleans, and "any" (since it
	// maps to interface{}).
	SimpleKind kind = iota

	// StructKind is the category for a JSON Schema that declares a JSON
	// object without any additional (arbitrary) properties.
	StructKind

	// MapKind is the category for a JSON Schema that declares a JSON
	// object with additional (arbitrary) properties that have a non-"any"
	// schema type.
	MapKind

	// AnyStructKind is the category for a JSON Schema that declares a
	// JSON object with additional (arbitrary) properties that can be any
	// type.
	AnyStructKind

	// ArrayKind is the category for a JSON Schema that declares an
	// "array" type.
	ArrayKind

	// ReferenceKind is the category for a JSON Schema that is a reference
	// to another JSON Schema.  During code generation, these references
	// are resolved using the API.schemas map.
	// See https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.28
	// for more details on the format.
	ReferenceKind
)

Variables

This section is empty.

Functions

func NewAPI

func NewAPI(serviceConfig *serviceconfig.Service, contents []byte, discoveryConfig *api.Discovery) (*api.API, error)

NewAPI parses the discovery doc in `contents` and returns the corresponding `api.API` model.

func ParseUriTemplate

func ParseUriTemplate(uriTemplate string) (*api.PathTemplate, error)

ParseUriTemplate parses a [RFC 6570] URI template as an `api.PathTemplate`.

In sidekick we need to capture the structure of the URI template for the codec(s) to emit good templates with them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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