package aggregator
import "k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator"
Index ¶
- func IsLocalAPIService(apiServiceName string) bool
- type Downloader
- func NewDownloader() Downloader
- func (s *Downloader) Download(handler http.Handler, etagList map[string]string) (returnSpec map[string]*SpecETag, err error)
- type SpecAggregator
- type SpecETag
Functions ¶
func IsLocalAPIService ¶
IsLocalAPIService returns true for local specs from delegates.
Types ¶
type Downloader ¶
type Downloader struct { }
Downloader is the OpenAPI downloader type. It will try to download spec from /openapi/v3 and /openap/v3/<group>/<version> endpoints.
func NewDownloader ¶
func NewDownloader() Downloader
NewDownloader creates a new OpenAPI Downloader.
func (*Downloader) Download ¶
func (s *Downloader) Download(handler http.Handler, etagList map[string]string) (returnSpec map[string]*SpecETag, err error)
Download downloads OpenAPI v3 for all groups of a given handler
type SpecAggregator ¶
type SpecAggregator interface { AddUpdateAPIService(handler http.Handler, apiService *v1.APIService) UpdateAPIServiceSpec(apiServiceName string) error RemoveAPIServiceSpec(apiServiceName string) GetAPIServiceNames() []string }
SpecAggregator calls out to http handlers of APIServices and caches specs. It keeps state of the last known specs including the http etag. TODO(jefftree): remove the downloading and caching and proxy directly to the APIServices. This is possible because we don't have to merge here, which is cpu intensive in v2
func BuildAndRegisterAggregator ¶
func BuildAndRegisterAggregator(downloader Downloader, delegationTarget server.DelegationTarget, pathHandler common.PathHandlerByGroupVersion) (SpecAggregator, error)
BuildAndRegisterAggregator registered OpenAPI aggregator handler. This function is not thread safe as it only being called on startup.
type SpecETag ¶
type SpecETag struct {
// contains filtered or unexported fields
}
SpecETag is a OpenAPI v3 spec and etag pair for the endpoint of each OpenAPI group/version
Source Files ¶
aggregator.go downloader.go
- Version
- v0.23.0-rc.1
- Published
- Dec 4, 2021
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 1 hour ago –
Tools for package owners.