discovery

package
v0.1.52 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DiscoveryListURL is the URL to fetch the list of all Google APIs
	DiscoveryListURL = "https://discovery.googleapis.com/discovery/v1/apis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides access to Google API Discovery documents

func NewClient

func NewClient() *Client

NewClient creates a new Discovery client

func (*Client) ClearCache

func (c *Client) ClearCache()

ClearCache clears all cached data

func (*Client) GetAPI

func (c *Client) GetAPI(ctx context.Context, serviceID string) (*googleapismodule.API, error)

GetAPI fetches the full API specification for a given service ID

func (*Client) GetMethods

func (c *Client) GetMethods(ctx context.Context, serviceID string) ([]googleapismodule.MethodInfo, error)

GetMethods returns all available methods for a given service

func (*Client) GetPreferredServices

func (c *Client) GetPreferredServices(ctx context.Context) ([]ServiceOption, error)

GetPreferredServices returns only the preferred version of each service

func (*Client) GetServices

func (c *Client) GetServices(ctx context.Context) ([]ServiceOption, error)

GetServices returns a list of available Google API services

type ServiceOption

type ServiceOption struct {
	ID          string // e.g., "sheets:v4"
	Name        string // e.g., "sheets"
	Version     string // e.g., "v4"
	Title       string // e.g., "Google Sheets API"
	Description string
	Preferred   bool
}

ServiceOption represents a service available in the discovery list

Jump to

Keyboard shortcuts

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