compiler

package
v4.22.10 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceSpecFiles

func ResourceSpecFiles(rcConfig *config.ResourceSet) ([]string, error)

ResourceSpecFiles returns all matching spec files for a config.Resource.

Types

type Compiler

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

A Compiler checks and builds versioned API resource inputs into aggregated OpenAPI versioned outputs, as determined by an API project configuration.

func New

func New(ctx context.Context, proj *config.Project, options ...CompilerOption) (*Compiler, error)

New returns a new Compiler for a given project configuration.

func (*Compiler) Build

func (c *Compiler) Build(ctx context.Context, apiName string) error

Build builds an aggregate versioned OpenAPI spec for a specific API by name in the project.

func (*Compiler) BuildAll

func (c *Compiler) BuildAll(ctx context.Context) error

BuildAll builds all APIs in the project.

func (*Compiler) LintOutput

func (c *Compiler) LintOutput(ctx context.Context, apiName string) error

LintOutput applies configured linting rules to the build output.

func (*Compiler) LintOutputAll

func (c *Compiler) LintOutputAll(ctx context.Context) error

LintOutputAll lints output of all APIs in the project.

func (*Compiler) LintResources

func (c *Compiler) LintResources(ctx context.Context, apiName string) error

LintResources checks the inputs of an API's resources with the configured linter.

func (*Compiler) LintResourcesAll

func (c *Compiler) LintResourcesAll(ctx context.Context) error

LintResourcesAll lints resources in all APIs in the project.

type CompilerOption

type CompilerOption func(*Compiler) error

CompilerOption applies a configuration option to a Compiler.

func LinterFactory

func LinterFactory(f func(ctx context.Context, lc *config.Linter) (linter.Linter, error)) CompilerOption

LinterFactory configures a Compiler to use a custom factory function for instantiating Linters.

Jump to

Keyboard shortcuts

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