aggregator

package
v0.32.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAPIServiceNotFound = errors.New("resource not found")

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) OpenAPIV3Root added in v0.24.0

func (s *Downloader) OpenAPIV3Root(handler http.Handler) (*handler3.OpenAPIV3Discovery, int, error)

OpenAPIV3Root downloads the OpenAPI V3 root document from an APIService

type NotFoundError added in v0.24.0

type NotFoundError struct {
}

func (*NotFoundError) Error added in v0.24.0

func (e *NotFoundError) Error() string

type SpecProxier added in v0.24.0

type SpecProxier interface {
	AddUpdateAPIService(handler http.Handler, apiService *v1.APIService)
	// UpdateAPIServiceSpec updates the APIService. It returns ErrAPIServiceNotFound if the APIService doesn't exist.
	UpdateAPIServiceSpec(apiServiceName string) error
	RemoveAPIServiceSpec(apiServiceName string)
	GetAPIServiceNames() []string
}

SpecProxier proxies OpenAPI V3 requests to their respective APIService

func BuildAndRegisterAggregator

func BuildAndRegisterAggregator(downloader Downloader, delegationTarget server.DelegationTarget, aggregatorService *restful.Container, openAPIConfig *common.OpenAPIV3Config, pathHandler common.PathHandlerByGroupVersion) (SpecProxier, error)

BuildAndRegisterAggregator registered OpenAPI aggregator handler. This function is not thread safe as it only being called on startup.

Jump to

Keyboard shortcuts

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