simplebuild

package
v8.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 21 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 CheckBreakingChanges added in v8.1.0

func CheckBreakingChanges(docs DocSet) error

func NewRefResolver

func NewRefResolver() refResolver

func ResourceSpecFiles

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

Types

type DocSet

type DocSet []VersionedDoc

type DocWriter added in v8.0.1

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

func NewWriter added in v8.0.1

func NewWriter(cfg config.Output, appendOutputFiles bool) (*DocWriter, error)

NewWriter initialises any output paths, removing existing files and directories if they are present.

func (*DocWriter) Finalize added in v8.0.1

func (out *DocWriter) Finalize() error

func (*DocWriter) Write added in v8.0.1

func (out *DocWriter) Write(doc VersionedDoc) error

Write writes compiled specs to a single directory in YAML and JSON formats. Call Finalize after to populate other directories.

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

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
}

func (VersionedDoc) ApplyOverlays added in v8.0.1

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

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