"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
- "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/restapi/operations/a1_e_i_data_delivery"
- "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/restapi/operations/a1_mediator"
+ "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/restapi/operations/a1_e_i_data_delivery"
+ "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/restapi/operations/a1_mediator"
)
// NewA1API creates a new A1 instance
PreServerShutdown: func() {},
ServerShutdown: func() {},
spec: spec,
+ useSwaggerUI: false,
ServeError: errors.ServeError,
BasicAuthenticator: security.BasicAuth,
APIKeyAuthenticator: security.APIKeyAuth,
defaultConsumes string
defaultProduces string
Middleware func(middleware.Builder) http.Handler
+ useSwaggerUI bool
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
+
// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
+
// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
A1MediatorA1ControllerGetPolicyInstanceStatusHandler a1_mediator.A1ControllerGetPolicyInstanceStatusHandler
// A1MediatorA1ControllerGetPolicyTypeHandler sets the operation handler for the a1 controller get policy type operation
A1MediatorA1ControllerGetPolicyTypeHandler a1_mediator.A1ControllerGetPolicyTypeHandler
+
// ServeError is called when an error is received, there is a default handler
// but you can set your own with this
ServeError func(http.ResponseWriter, *http.Request, error)
Logger func(string, ...interface{})
}
+// UseRedoc for documentation at /docs
+func (o *A1API) UseRedoc() {
+ o.useSwaggerUI = false
+}
+
+// UseSwaggerUI for documentation at /docs
+func (o *A1API) UseSwaggerUI() {
+ o.useSwaggerUI = true
+}
+
// SetDefaultProduces sets the default produces media type
func (o *A1API) SetDefaultProduces(mediaType string) {
o.defaultProduces = mediaType
if o.Middleware != nil {
return o.Middleware(builder)
}
+ if o.useSwaggerUI {
+ return o.context.APIHandlerSwaggerUI(builder)
+ }
return o.context.APIHandler(builder)
}