aggregator

package
v0.23.13-rc.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLocalAPIService

func IsLocalAPIService(apiServiceName string) bool

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

Jump to

Keyboard shortcuts

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