compiler

package
v8.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmbedGoTmpl = template.Must(template.New("embed.go").Parse(`
// Code generated by Vervet. DO NOT EDIT.

package {{ .Package }}

import "embed"

// Embed compiled OpenAPI specs in Go projects.

{{ range .VersionSpecFiles -}}
//go:embed {{ . }}
{{ end }}
// Versions contains OpenAPI specs for each distinct release version.
var Versions embed.FS
`[1:]))

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(apiName string, stopVersion vervet.Version) 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, stopVersion vervet.Version) error

BuildAll builds all APIs in the project, before the stop version.

type CompilerOption

type CompilerOption func(*Compiler) error

CompilerOption applies a configuration option to a Compiler.

Jump to

Keyboard shortcuts

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