openapi

package
v0.23.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 121

Documentation

Overview

Package openapi is a collection of libraries for fetching the openapi spec from a Kubernetes server and then indexing the type definitions. The openapi spec contains the object model definitions and extensions metadata such as the patchStrategy and patchMergeKey for creating patches.

Index

Constants

View Source
const PrintColumnsKey = "x-kubernetes-print-columns"

PrintColumnsKey is the key that defines which columns should be printed

Variables

This section is empty.

Functions

func GetPrintColumns

func GetPrintColumns(extensions spec.Extensions) (string, bool)

GetPrintColumns looks for the open API extension for the display columns.

Types

type CachedOpenAPIGetter added in v0.21.0

type CachedOpenAPIGetter struct {

	// Cached results
	sync.Once
	// contains filtered or unexported fields
}

CachedOpenAPIGetter fetches the openapi schema once and then caches it in memory

func NewOpenAPIGetter

func NewOpenAPIGetter(openAPIClient discovery.OpenAPISchemaInterface) *CachedOpenAPIGetter

NewOpenAPIGetter returns an object to return OpenAPIDatas which reads from a server, and then stores in memory for subsequent invocations

func (*CachedOpenAPIGetter) OpenAPISchema added in v0.21.0

func (g *CachedOpenAPIGetter) OpenAPISchema() (*openapi_v2.Document, error)

OpenAPISchema implements OpenAPISchemaInterface.

type CachedOpenAPIParser added in v0.21.0

type CachedOpenAPIParser struct {

	// Cached results
	sync.Once
	// contains filtered or unexported fields
}

func NewOpenAPIParser added in v0.21.0

func NewOpenAPIParser(openAPIClient discovery.OpenAPISchemaInterface) *CachedOpenAPIParser

func (*CachedOpenAPIParser) Parse added in v0.21.0

func (p *CachedOpenAPIParser) Parse() (Resources, error)

type Resources

type Resources interface {
	LookupResource(gvk schema.GroupVersionKind) proto.Schema
}

Resources interface describe a resources provider, that can give you resource based on group-version-kind.

func NewOpenAPIData

func NewOpenAPIData(doc *openapi_v2.Document) (Resources, error)

NewOpenAPIData creates a new `Resources` out of the openapi document

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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