api

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0, NCSA Imports: 18 Imported by: 4

Documentation

Overview

Package api provides a union of the filetree, xrefs, and graph interfaces and a command-line flag parser.

Index

Constants

View Source
const (
	// CommonDefault is the common Kythe default API specification for Flag
	CommonDefault = "https://xrefs-dot-kythe-repo.appspot.com"

	// CommonFlagUsage is the common Kythe usage description used for Flag
	CommonFlagUsage = "" /* 139-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	xrefs.Service
	graph.Service
	filetree.Service
	identifiers.Service

	// Close releases the underlying resources for the API.
	Close(context.Context) error
}

Interface is a union of the xrefs and filetree interfaces.

func Flag

func Flag(name, value, usage string) *Interface

Flag defines an api Interface flag with specified name, default value, and usage description. The return value is the address of an Interface variable that stores the value of the flag.

func ParseSpec

func ParseSpec(apiSpec string) (Interface, error)

ParseSpec parses the given specification and returns an opened handle to an API Interface. The following formats are currently supported:

  • http:// URL pointed at a JSON web API
  • https:// URL pointed at a JSON web API
  • local path to a LevelDB serving table

Jump to

Keyboard shortcuts

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