openapi

package
v1.2.0-alpha.5....-8a98da9 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: Apache-2.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationController

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

AggregationController periodically check for changes in OpenAPI specs of APIServices and update/remove them if necessary.

func NewAggregationController

func NewAggregationController(downloader *Downloader, openAPIAggregationManager AggregationManager) *AggregationController

NewAggregationController creates new OpenAPI aggregation controller.

func (*AggregationController) AddAPIService

func (c *AggregationController) AddAPIService(handler http.Handler, apiService *apiregistration.APIService)

AddAPIService adds a new API Service to OpenAPI Aggregation.

func (*AggregationController) RemoveAPIService

func (c *AggregationController) RemoveAPIService(apiServiceName string)

RemoveAPIService removes API Service from OpenAPI Aggregation Controller.

func (*AggregationController) Run

func (c *AggregationController) Run(stopCh <-chan struct{})

Run starts OpenAPI AggregationController

func (*AggregationController) UpdateAPIService

func (c *AggregationController) UpdateAPIService(handler http.Handler, apiService *apiregistration.APIService)

UpdateAPIService updates API Service's info and handler.

type AggregationManager

type AggregationManager interface {
	AddUpdateAPIService(handler http.Handler, apiService *apiregistration.APIService) error
	UpdateAPIServiceSpec(apiServiceName string, spec *spec.Swagger, etag string) error
	RemoveAPIServiceSpec(apiServiceName string) error
	GetAPIServiceInfo(apiServiceName string) (handler http.Handler, etag string, exists bool)
}

AggregationManager is the interface between this controller and OpenAPI Aggregator service.

func BuildAndRegisterAggregator

func BuildAndRegisterAggregator(downloader *Downloader, delegationTarget server.DelegationTarget, webServices []*restful.WebService,
	config *common.Config, pathHandler common.PathHandler) (AggregationManager, error)

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

type Downloader

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

Downloader is the OpenAPI downloader type. It will try to download spec from /swagger.json endpoint.

func NewDownloader

func NewDownloader(contextMapper request.RequestContextMapper) Downloader

NewDownloader creates a new OpenAPI Downloader.

func (*Downloader) Download

func (s *Downloader) Download(handler http.Handler, etag string) (returnSpec *spec.Swagger, newEtag string, httpStatus int, err error)

Download downloads openAPI spec from /swagger.json endpoint of the given handler. httpStatus is only valid if err == nil

Jump to

Keyboard shortcuts

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