handler

package
v0.0.0-...-39a7bf8 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAPIService

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

OpenAPIService is the service responsible for serving OpenAPI spec. It has the ability to safely change the spec while serving it.

func BuildAndRegisterOpenAPIService

func BuildAndRegisterOpenAPIService(servePath string, webServices []*restful.WebService, config *common.Config, handler common.PathHandler) (*OpenAPIService, error)

BuildAndRegisterOpenAPIService builds the spec and registers a handler to provides access to it. Use this method if your OpenAPI spec is static. If you want to update the spec, use BuildOpenAPISpec then RegisterOpenAPIService.

func RegisterOpenAPIService

func RegisterOpenAPIService(openapiSpec *spec.Swagger, servePath string, handler common.PathHandler) (*OpenAPIService, error)

RegisterOpenAPIService registers a handler to provides access to provided swagger spec. Note: servePath should end with ".json" as the RegisterOpenAPIService assume it is serving a json file and will also serve .pb and .gz files.

func (*OpenAPIService) UpdateSpec

func (o *OpenAPIService) UpdateSpec(openapiSpec *spec.Swagger) (err error)

Jump to

Keyboard shortcuts

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