apispec

package
v0.0.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProtoFiles added in v0.0.15

func GetProtoFiles() (files map[string]string, err error)

func ParseStreamToSwagger

func ParseStreamToSwagger(stream io.Reader) (swagger *spec.Swagger, err error)

func ParseToSwagger

func ParseToSwagger(data []byte) (swagger *spec.Swagger, err error)

func ParseURLToSwagger

func ParseURLToSwagger(swaggerURL string) (swagger *spec.Swagger, err error)

Types

type APIConverage

type APIConverage interface {
	HaveAPI(path, method string) (exist bool)
	APICount() (count int)
}

func NewFakeAPISpec

func NewFakeAPISpec(apis [][]string) APIConverage

NewFakeAPISpec creates a new instance of fakeAPISpec

type SwaggerAPI

type SwaggerAPI struct {
	Swagger *spec.Swagger
	ApiMap  map[string][]string
}

func NewSwaggerAPI added in v0.0.17

func NewSwaggerAPI(swagger *spec.Swagger) *SwaggerAPI

func (*SwaggerAPI) APICount added in v0.0.17

func (s *SwaggerAPI) APICount() (count int)

APICount return the count of APIs

func (*SwaggerAPI) HaveAPI added in v0.0.17

func (s *SwaggerAPI) HaveAPI(path, method string) (exist bool)

HaveAPI check if the swagger has the API. If the path is /api/v1/names/linuxsuren, then will match /api/v1/names/{name}

Jump to

Keyboard shortcuts

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