discovery

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: GPL-3.0 Imports: 13 Imported by: 3

Documentation

Overview

Package discovery package implements helpers for clients to discover language drivers supported by Babelfish.

The drivers discovery process uses Github API under the hood to get the most up-to-date information. This process may fail in case of Github rate limiting, and the discovery will fallback to a drivers list hosted by Babelfish project, which must be reasonably up-to-date.

It is also possible to provide Github API token by setting the GITHUB_TOKEN environment variable to prevent the rate limiting.

Index

Constants

View Source
const (
	GithubOrg = "bblfsh"
)

Variables

This section is empty.

Functions

func GithubClient added in v3.3.1

func GithubClient() *github.Client

GithubClient returns a lazily-initialized singleton Github API client.

API token can be provided with GITHUB_TOKEN environment variable. The public API rate limits will apply without it.

Types

type Driver

type Driver struct {
	manifest.Manifest
	// contains filtered or unexported fields
}

Driver is an object describing language driver and it's repository-related information.

func OfficialDrivers

func OfficialDrivers(ctx context.Context, opt *Options) ([]Driver, error)

OfficialDrivers lists all available language drivers for Babelfish.

func (*Driver) LatestVersion added in v3.2.0

func (d *Driver) LatestVersion(ctx context.Context) (Version, error)

LatestVersion returns a latest version of the driver. It returns an empty version if there are no releases of the driver.

func (Driver) RepositoryURL

func (d Driver) RepositoryURL() string

RepositoryURL returns Github repository URL for browsers (not git).

func (*Driver) Versions added in v3.2.0

func (d *Driver) Versions(ctx context.Context) ([]Version, error)

Versions returns a list of available driver versions sorted in descending order (first element is the latest version).

type Options

type Options struct {
	Organization  string // Github organization name
	NamesOnly     bool   // driver manifest will only have Language field populated
	NoMaintainers bool   // do not load maintainers list
	NoSDKVersion  bool   // do not check SDK version
	NoBuildInfo   bool   // do not load build info
	NoStatic      bool   // do not use a static manifest - discover drivers
}

Options controls how drivers are being discovered and what information is fetched for them.

type Version added in v3.2.0

type Version = semver.Version

Version is a semantic version.

Jump to

Keyboard shortcuts

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