apis

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeName

func NormalizeName(name string) string

NormalizeName normalizes API names and aliases for lookup.

Types

type API

type API struct {
	Name        string   `json:"name"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	BaseURL     string   `json:"base_url"`
	OpenAPIURL  string   `json:"openapi_url,omitempty"`
	DocsURL     string   `json:"docs_url,omitempty"`
	Aliases     []string `json:"aliases,omitempty"`
	Public      bool     `json:"public"`
}

API describes one public Open Data Hub API surface known to the CLI.

type Registry

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

Registry stores APIs by name and alias.

func DefaultRegistry

func DefaultRegistry() *Registry

DefaultRegistry returns the public API set used by the CLI.

func NewRegistry

func NewRegistry(entries []API) (*Registry, error)

NewRegistry builds a registry and validates names and aliases.

func (*Registry) Find

func (r *Registry) Find(name string) (API, bool)

Find returns an API by canonical name or alias.

func (*Registry) List

func (r *Registry) List() []API

List returns APIs sorted by canonical name.

func (*Registry) Names

func (r *Registry) Names() []string

Names returns the sorted canonical API names.

Jump to

Keyboard shortcuts

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