31 lines
510 B
Go
31 lines
510 B
Go
package port
|
|
|
|
import "net/url"
|
|
|
|
type OpenAPIConfigServer struct {
|
|
URL *url.URL
|
|
}
|
|
|
|
type OpenAPIConfig struct {
|
|
Enabled bool
|
|
SwaggerEnabled bool
|
|
BasePath string
|
|
Servers []OpenAPIConfigServer
|
|
}
|
|
|
|
type apiHTTPHandlerConfig struct {
|
|
openAPI OpenAPIConfig
|
|
}
|
|
|
|
type APIHTTPHandlerOption func(cfg *apiHTTPHandlerConfig)
|
|
|
|
func newAPIHTTPHandlerConfig(opts ...APIHTTPHandlerOption) *apiHTTPHandlerConfig {
|
|
cfg := &apiHTTPHandlerConfig{}
|
|
|
|
for _, opt := range opts {
|
|
opt(cfg)
|
|
}
|
|
|
|
return cfg
|
|
}
|