compiler

package
v5.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 17 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, lint bool, 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) LintResources

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

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

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