extractor

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCachingUnstructuredExtractor

func NewCachingUnstructuredExtractor(ctx context.Context, dc discovery.DiscoveryInterface, cache *GVKParserCache) (applymetav1.UnstructuredExtractor, error)

NewCachingUnstructuredExtractor returns a new cachingUnstructuredExtractor

Types

type GVKParserCache

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

GVKParserCache holds the cached parser instances and the ETags of the associated provider config. Parsers are generated and cached per GroupVersion

type GVKParserCacheManager

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

GVKParserCacheManager maintains GVK parser cache stores for each provider config. The implementation is thread-safe.

func NewGVKParserCacheManager

func NewGVKParserCacheManager(opts ...GVKParserCacheManagerOption) *GVKParserCacheManager

NewGVKParserCacheManager returns a new empty *GVKParserCacheManager.

func (*GVKParserCacheManager) LoadOrNewCacheForProviderConfig

func (cm *GVKParserCacheManager) LoadOrNewCacheForProviderConfig(pc *v1alpha1.ProviderConfig) (*GVKParserCache, error)

LoadOrNewCacheForProviderConfig returns the *GVKParserCache for the given provider config, initializing an empty cache for the first use. the implementation is concurrency-safe.

func (*GVKParserCacheManager) RemoveCache

func (cm *GVKParserCacheManager) RemoveCache(pc *v1alpha1.ProviderConfig)

RemoveCache removes the cache for the given provider config.

type GVKParserCacheManagerOption

type GVKParserCacheManagerOption func(cache *GVKParserCacheManager)

GVKParserCacheManagerOption lets you configure a *GVKParserCacheManager.

type GvkParser

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

GvkParser contains a Parser that allows introspecting the schema.

func NewGVKParser

func NewGVKParser(componentNameToSchema map[string]*spec.Schema, preserveUnknownFields bool) (*GvkParser, error)

NewGVKParser builds a GVKParser from a directory of OpenAPI schema (instead of proto.Models in upstream k8s apimachinery implementation)

This will automatically find the proper version of the object, and the corresponding schema information.

func (*GvkParser) Type

Type returns a helper which can produce objects of the given type. Any errors are deferred until a further function is called.

type OpenAPIGroupVersion

type OpenAPIGroupVersion interface {
	// Schema is the context-accepting variant of the upstream client-go implementation
	Schema(ctx context.Context, contentType string) ([]byte, error)
}

OpenAPIGroupVersion is the context-aware variant of openapi.GroupVersion

Jump to

Keyboard shortcuts

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