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)
Click to show internal directories.
Click to hide internal directories.