simplebuild

package
v7.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, project *config.Project, startDate vervet.Version, appendOutputFiles bool) error

Build compiles the versioned resources in a project configuration based on simplified versioning rules, after the start date.

func NewRefResolver

func NewRefResolver(doc *openapi3.T) refResolver

func ResourceSpecFiles

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

Types

type DocSet

type DocSet []VersionedDoc

func (DocSet) ApplyOverlays

func (docs DocSet) ApplyOverlays(ctx context.Context, cfgs []*config.Overlay) error

func (DocSet) Write

func (docs DocSet) Write(dir string, appendOutputFiles bool) error

Write writes compiled specs to a single directory in YAML and JSON formats. Unlike WriteOutputs this function assumes the destination directory does not already exist.

func (DocSet) WriteOutputs

func (docs DocSet) WriteOutputs(cfg config.Output, appendOutputFiles bool) error

WriteOutputs writes compiled specs to all directories specified by the given api config. Removes any existing builds if they are present.

type OpKey

type OpKey struct {
	Path   string
	Method string
}

type Operations

type Operations map[OpKey]VersionSet

func LoadPaths

func LoadPaths(ctx context.Context, api *config.API) (Operations, error)

func (Operations) Build

func (ops Operations) Build(startVersion vervet.Version) (DocSet, error)

func (Operations) VersionDates

func (ops Operations) VersionDates() []time.Time

type VersionSet

type VersionSet []VersionedOp

func (VersionSet) Annotate

func (vs VersionSet) Annotate()

Annotate adds Snyk specific extensions to openapi operations. These extensions are:

  • x-snyk-api-version: version where the operation was defined
  • x-snyk-api-releases: all versions of this api
  • x-snyk-deprecated-by: if there is a later version of this operation, the version of that operation
  • x-snyk-sunset-eligible: the date after this operation can be sunset
  • x-snyk-api-resource: what resource this operation acts on
  • x-snyk-api-lifecycle: status of the operation, can be one of: [ unreleased, released, deprecated, sunset ]

func (VersionSet) GetLatest

func (vs VersionSet) GetLatest(before time.Time) *openapi3.Operation

type VersionedDoc

type VersionedDoc struct {
	VersionDate time.Time
	Doc         *openapi3.T
}

type VersionedOp

type VersionedOp struct {
	Version      vervet.Version
	Operation    *openapi3.Operation
	ResourceName string
}

Jump to

Keyboard shortcuts

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