apiutil

package
v1.79.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDynamicRESTMapper

func NewDynamicRESTMapper(cfg *rest.Config, opts ...DynamicRESTMapperOption) (meta.RESTMapper, error)

NewDynamicRESTMapper returns a dynamic RESTMapper for cfg. The dynamic RESTMapper dynamically discovers resource types at runtime. opts configure the RESTMapper.

Types

type DynamicRESTMapperOption

type DynamicRESTMapperOption func(*dynamicRESTMapper) error

DynamicRESTMapperOption is a functional option on the dynamicRESTMapper.

var WithExperimentalLazyMapper DynamicRESTMapperOption = func(drm *dynamicRESTMapper) error {
	drm.useLazyRestmapper = true
	return nil
}

WithExperimentalLazyMapper enables experimental more advanced Lazy Restmapping mechanism.

var WithLazyDiscovery DynamicRESTMapperOption = func(drm *dynamicRESTMapper) error {
	drm.lazy = true
	return nil
}

WithLazyDiscovery prevents the RESTMapper from discovering REST mappings until an API call is made.

func WithCustomMapper

func WithCustomMapper(newMapper func() (meta.RESTMapper, error)) DynamicRESTMapperOption

WithCustomMapper supports setting a custom RESTMapper refresher instead of the default method, which uses a discovery client.

This exists mainly for testing, but can be useful if you need tighter control over how discovery is performed, which discovery endpoints are queried, etc.

func WithLimiter

func WithLimiter(lim *rate.Limiter) DynamicRESTMapperOption

WithLimiter sets the RESTMapper's underlying limiter to lim.

Jump to

Keyboard shortcuts

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