sdk.v3: gopkg.in/bblfsh/sdk.v3/driver/manifest Index | Files | Directories

package manifest

import "gopkg.in/bblfsh/sdk.v3/driver/manifest"

Index

Package Files

manifest.go

Constants

const Filename = "manifest.toml"

func CurrentSDKMajor Uses

func CurrentSDKMajor() int

CurrentSDKMajor returns a major version of this SDK package.

func LoadRuntimeInfo Uses

func LoadRuntimeInfo(m *Manifest, read ReadFunc) error

LoadRuntimeInfo reads a build manifest file with a given open function and sets runtime-related information to m.

func SDKVersion Uses

func SDKVersion(read ReadFunc) (string, error)

SDKVersion detects a Babelfish SDK version of a driver. Returned format is "x[.y[.z]]".

type DevelopmentStatus Uses

type DevelopmentStatus string
const (
    Planning DevelopmentStatus = "planning"
    PreAlpha DevelopmentStatus = "pre-alpha"
    Alpha    DevelopmentStatus = "alpha"
    Beta     DevelopmentStatus = "beta"
    Stable   DevelopmentStatus = "stable"
    Mature   DevelopmentStatus = "mature"
    Inactive DevelopmentStatus = "inactive"
)

func (DevelopmentStatus) Rank Uses

func (s DevelopmentStatus) Rank() int

Rank is an integer indicating driver stability. Higher is better.

type Documentation Uses

type Documentation struct {
    Description string `toml:"description,omitempty" json:",omitempty"`
    Caveats     string `toml:"caveats,omitempty" json:",omitempty"`
}

type Feature Uses

type Feature string

Feature describes which level of information driver can produce.

const (
    // AST is a basic feature required for the driver. Driver can parse files and return native language AST.
    AST Feature = "ast"
    // UAST feature indicates that driver properly converts AST to UAST without further annotating it.
    UAST Feature = "uast"
    // Roles feature indicates that driver annotates UAST with roles. All node types are annotated.
    Roles Feature = "roles"
)

type Maintainer Uses

type Maintainer struct {
    Name   string `json:",omitempty"`
    Email  string `json:",omitempty"`
    Github string `json:",omitempty"` // github handle
}

Maintainer is an information about project maintainer.

func Maintainers Uses

func Maintainers(read ReadFunc) ([]Maintainer, error)

Maintainers reads and parses the MAINTAINERS file using the provided function.

func (Maintainer) GithubURL Uses

func (m Maintainer) GithubURL() string

GithubURL returns github profile URL.

func (Maintainer) URL Uses

func (m Maintainer) URL() string

URL returns a contact of the maintainer (either Github profile or email link).

type Manifest Uses

type Manifest struct {
    Name          string            `toml:"name"` // human-readable name
    Language      string            `toml:"language"`
    Aliases       []string          `toml:"aliases"` // language name aliases, see Enry/Linguist
    Version       string            `toml:"version,omitempty" json:",omitempty"`
    Build         time.Time         `toml:"build,omitempty" json:",omitempty"`
    Status        DevelopmentStatus `toml:"status"`
    SDKVersion    string            `toml:"-"` // read from go.mod
    Documentation *Documentation    `toml:"documentation,omitempty" json:",omitempty"`
    Runtime       struct {
        NativeVersion string `toml:"-" json:",omitempty"`
        GoVersion     string `toml:"-" json:",omitempty"`
    }   `toml:"-" json:"Runtimes"` // read from build.yml
    Features    []Feature    `toml:"features" json:",omitempty"`
    Maintainers []Maintainer `toml:"-" json:",omitempty"` // read from MAINTAINERS
}

func Load Uses

func Load(path string) (*Manifest, error)

Load reads a manifest and decode the content into a new Manifest struct.

func (*Manifest) Decode Uses

func (m *Manifest) Decode(r io.Reader) error

Decode decodes reads r and decodes it into m

func (*Manifest) Encode Uses

func (m *Manifest) Encode(w io.Writer) error

Encode encodes m in toml format and writes the restult to w

func (Manifest) ForCurrentSDK Uses

func (m Manifest) ForCurrentSDK() bool

ForCurrentSDK indicates that driver is built for the same major version of SDK.

func (Manifest) InDevelopment Uses

func (m Manifest) InDevelopment() bool

InDevelopment indicates that driver is incomplete and should only be used for development purposes.

func (Manifest) IsRecommended Uses

func (m Manifest) IsRecommended() bool

IsRecommended indicates that driver is stable enough to be used in production.

func (Manifest) SDKMajor Uses

func (m Manifest) SDKMajor() int

SDKMajor returns a major version of SDK this driver was built for.

func (Manifest) Supports Uses

func (m Manifest) Supports(f Feature) bool

Supports checks if driver supports specified feature.

type ReadFunc Uses

type ReadFunc func(path string) ([]byte, error)

ReadFunc is a function for fetching a file using a relative file path. It returns an empty error a nil slice in case file does not exist.

func InDir Uses

func InDir(dir string) ReadFunc

InDir returns a function that read files in the specified directory.

Directories

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

Package manifest imports 16 packages (graph). Updated 2019-11-22. Refresh now. Tools for package owners.