Documentation ¶
Index ¶
- Constants
- func AddJwtAuth(ws *restful.WebService, ff restful.FilterFunction)
- func AddMetaDataTags(ws *restful.WebService, tags []string)
- func Serve(container *restful.Container, servIndex int)
- func ServeDefault()
- type OAISecurity
- type OpenAPIConfig
- type OpenapiTagConfig
- type OpenapiUIConfig
- type RestfulConfig
- type ServerConfig
Constants ¶
View Source
const ( // KeyOpenAPITags is a Metadata key for a restful Route KeyOpenAPITags = restfulSpec.KeyOpenAPITags SecurityDefinitionKey = "OAPI_SECURITY_DEFINITION" )
Variables ¶
This section is empty.
Functions ¶
func AddJwtAuth ¶ added in v0.2.1
func AddJwtAuth(ws *restful.WebService, ff restful.FilterFunction)
AddJwtAuth add metadata tags to Webservice all routes
func AddMetaDataTags ¶
func AddMetaDataTags(ws *restful.WebService, tags []string)
AddMetaDataTags add metadata tags to Webservice all routes
func Serve ¶
func Serve(container *restful.Container, servIndex int)
Serve rest webservice index start from 1 func Serve(svc []*restful.WebService) {
func ServeDefault ¶
func ServeDefault()
ServeDefault serve with default container and first server config
Types ¶
type OAISecurity ¶ added in v0.2.0
type OAISecurity struct { Name string // SecurityDefinition name Scopes []string // Scopes for oauth2 }
func (*OAISecurity) Valid ¶ added in v0.2.0
func (s *OAISecurity) Valid() error
type OpenAPIConfig ¶
type OpenAPIConfig struct { Enabled bool `yaml:"enabled"` Host string `yaml:"host"` BasePath string `yaml:"base_path"` Schemas []string `yaml:"schemas"` Auth string Spec struct { Title string Description string `yaml:"desc"` Contact struct { Name string Email string URL string } `yaml:"contact"` License struct { Name string URL string } `yaml:"license"` Version string } Tags []OpenapiTagConfig `yaml:",flow"` UI OpenapiUIConfig `yaml:"ui"` }
OpenAPIConfig open api config
type OpenapiTagConfig ¶
OpenapiTagConfig openapi tag
type OpenapiUIConfig ¶
type OpenapiUIConfig struct { API string `yaml:"api"` Dist string `yaml:"dist"` Entrypoint string `yaml:"entrypoint"` External string `yaml:"external"` }
OpenapiUIConfig swagger ui config
type RestfulConfig ¶
type RestfulConfig struct { OpenAPI OpenAPIConfig `yaml:"openapi"` Servers []ServerConfig `yaml:"servers"` }
type ServerConfig ¶
type ServerConfig struct { Name string Addr string Description string OpenAPI OpenAPIConfig `yaml:"openapi"` }
ServerConfig
Click to show internal directories.
Click to hide internal directories.