Documentation
¶
Index ¶
- type SonataAPI
- func (o *SonataAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *SonataAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *SonataAPI) Authorizer() runtime.Authorizer
- func (o *SonataAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *SonataAPI) Context() *middleware.Context
- func (o *SonataAPI) DefaultConsumes() string
- func (o *SonataAPI) DefaultProduces() string
- func (o *SonataAPI) Formats() strfmt.Registry
- func (o *SonataAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *SonataAPI) Init()
- func (o *SonataAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *SonataAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *SonataAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *SonataAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *SonataAPI) Serve(builder middleware.Builder) http.Handler
- func (o *SonataAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *SonataAPI) SetDefaultConsumes(mediaType string)
- func (o *SonataAPI) SetDefaultProduces(mediaType string)
- func (o *SonataAPI) SetSpec(spec *loads.Document)
- func (o *SonataAPI) UseRedoc()
- func (o *SonataAPI) UseSwaggerUI()
- func (o *SonataAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SonataAPI ¶
type SonataAPI struct { Middleware func(middleware.Builder) http.Handler // 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 // JSONConsumer registers a consumer for the following mime types: // - application/json JSONConsumer runtime.Consumer // JSONProducer registers a producer for the following mime types: // - application/json JSONProducer runtime.Producer // BearerAuth registers a function that takes an access token and a collection of required scopes and returns a principal // it performs authentication based on an oauth2 bearer token provided in the request BearerAuth func(string, []string) (*models.Principal, error) // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal APIAuthorizer runtime.Authorizer // CancelProductOrderCancelProductOrderCreateHandler sets the operation handler for the cancel product order create operation CancelProductOrderCancelProductOrderCreateHandler cancel_product_order.CancelProductOrderCreateHandler // CancelProductOrderCancelProductOrderFindHandler sets the operation handler for the cancel product order find operation CancelProductOrderCancelProductOrderFindHandler cancel_product_order.CancelProductOrderFindHandler // CancelProductOrderCancelProductOrderGetHandler sets the operation handler for the cancel product order get operation CancelProductOrderCancelProductOrderGetHandler cancel_product_order.CancelProductOrderGetHandler // GeographicAddressGeographicAddressGetHandler sets the operation handler for the geographic address get operation GeographicAddressGeographicAddressGetHandler geographic_address.GeographicAddressGetHandler // GeographicAddressValidationGeographicAddressValidationCreateHandler sets the operation handler for the geographic address validation create operation GeographicAddressValidationGeographicAddressValidationCreateHandler geographic_address_validation.GeographicAddressValidationCreateHandler // GeographicSiteGeographicSiteFindHandler sets the operation handler for the geographic site find operation GeographicSiteGeographicSiteFindHandler geographic_site.GeographicSiteFindHandler // GeographicSiteGeographicSiteGetHandler sets the operation handler for the geographic site get operation GeographicSiteGeographicSiteGetHandler geographic_site.GeographicSiteGetHandler // NotificationNotificationProductOfferingQualificationCreationNotificationHandler sets the operation handler for the notification product offering qualification creation notification operation NotificationNotificationProductOfferingQualificationCreationNotificationHandler notification.NotificationProductOfferingQualificationCreationNotificationHandler // NotificationNotificationProductOfferingQualificationStateChangeNotificationHandler sets the operation handler for the notification product offering qualification state change notification operation NotificationNotificationProductOfferingQualificationStateChangeNotificationHandler notification.NotificationProductOfferingQualificationStateChangeNotificationHandler // NotificationNotificationProductOrderAttributeValueChangeNotificationHandler sets the operation handler for the notification product order attribute value change notification operation NotificationNotificationProductOrderAttributeValueChangeNotificationHandler notification.NotificationProductOrderAttributeValueChangeNotificationHandler // NotificationNotificationProductOrderCreationNotificationHandler sets the operation handler for the notification product order creation notification operation NotificationNotificationProductOrderCreationNotificationHandler notification.NotificationProductOrderCreationNotificationHandler // NotificationNotificationProductOrderInformationRequiredNotificationHandler sets the operation handler for the notification product order information required notification operation NotificationNotificationProductOrderInformationRequiredNotificationHandler notification.NotificationProductOrderInformationRequiredNotificationHandler // NotificationNotificationProductOrderStateChangeNotificationHandler sets the operation handler for the notification product order state change notification operation NotificationNotificationProductOrderStateChangeNotificationHandler notification.NotificationProductOrderStateChangeNotificationHandler // NotificationNotificationQuoteAttributeValueChangeNotificationHandler sets the operation handler for the notification quote attribute value change notification operation NotificationNotificationQuoteAttributeValueChangeNotificationHandler notification.NotificationQuoteAttributeValueChangeNotificationHandler // NotificationNotificationQuoteCreationNotificationHandler sets the operation handler for the notification quote creation notification operation NotificationNotificationQuoteCreationNotificationHandler notification.NotificationQuoteCreationNotificationHandler // NotificationNotificationQuoteInformationRequiredNotificationHandler sets the operation handler for the notification quote information required notification operation NotificationNotificationQuoteInformationRequiredNotificationHandler notification.NotificationQuoteInformationRequiredNotificationHandler // NotificationNotificationQuoteStateChangeNotificationHandler sets the operation handler for the notification quote state change notification operation NotificationNotificationQuoteStateChangeNotificationHandler notification.NotificationQuoteStateChangeNotificationHandler // ProductProductFindHandler sets the operation handler for the product find operation ProductProductFindHandler product.ProductFindHandler // ProductProductGetHandler sets the operation handler for the product get operation ProductProductGetHandler product.ProductGetHandler // ProductOfferingQualificationProductOfferingQualificationCreateHandler sets the operation handler for the product offering qualification create operation ProductOfferingQualificationProductOfferingQualificationCreateHandler product_offering_qualification.ProductOfferingQualificationCreateHandler // ProductOfferingQualificationProductOfferingQualificationFindHandler sets the operation handler for the product offering qualification find operation ProductOfferingQualificationProductOfferingQualificationFindHandler product_offering_qualification.ProductOfferingQualificationFindHandler // ProductOfferingQualificationProductOfferingQualificationGetHandler sets the operation handler for the product offering qualification get operation ProductOfferingQualificationProductOfferingQualificationGetHandler product_offering_qualification.ProductOfferingQualificationGetHandler // HubProductOfferingQualificationManagementHubDeleteHandler sets the operation handler for the product offering qualification management hub delete operation HubProductOfferingQualificationManagementHubDeleteHandler hub.ProductOfferingQualificationManagementHubDeleteHandler // HubProductOfferingQualificationManagementHubGetHandler sets the operation handler for the product offering qualification management hub get operation HubProductOfferingQualificationManagementHubGetHandler hub.ProductOfferingQualificationManagementHubGetHandler // HubProductOfferingQualificationManagementHubPostHandler sets the operation handler for the product offering qualification management hub post operation HubProductOfferingQualificationManagementHubPostHandler hub.ProductOfferingQualificationManagementHubPostHandler // ProductOrderProductOrderCreateHandler sets the operation handler for the product order create operation ProductOrderProductOrderCreateHandler product_order.ProductOrderCreateHandler // ProductOrderProductOrderFindHandler sets the operation handler for the product order find operation ProductOrderProductOrderFindHandler product_order.ProductOrderFindHandler // ProductOrderProductOrderGetHandler sets the operation handler for the product order get operation ProductOrderProductOrderGetHandler product_order.ProductOrderGetHandler // HubProductOrderManagementHubCreateHandler sets the operation handler for the product order management hub create operation HubProductOrderManagementHubCreateHandler hub.ProductOrderManagementHubCreateHandler // HubProductOrderManagementHubDeleteHandler sets the operation handler for the product order management hub delete operation HubProductOrderManagementHubDeleteHandler hub.ProductOrderManagementHubDeleteHandler // HubProductOrderManagementHubFindHandler sets the operation handler for the product order management hub find operation HubProductOrderManagementHubFindHandler hub.ProductOrderManagementHubFindHandler // QuoteQuoteCreateHandler sets the operation handler for the quote create operation QuoteQuoteCreateHandler quote.QuoteCreateHandler // QuoteQuoteFindHandler sets the operation handler for the quote find operation QuoteQuoteFindHandler quote.QuoteFindHandler // QuoteQuoteGetHandler sets the operation handler for the quote get operation QuoteQuoteGetHandler quote.QuoteGetHandler // HubQuoteManagementHubCreateHandler sets the operation handler for the quote management hub create operation HubQuoteManagementHubCreateHandler hub.QuoteManagementHubCreateHandler // HubQuoteManagementHubDeleteHandler sets the operation handler for the quote management hub delete operation HubQuoteManagementHubDeleteHandler hub.QuoteManagementHubDeleteHandler // HubQuoteManagementHubFindHandler sets the operation handler for the quote management hub find operation HubQuoteManagementHubFindHandler hub.QuoteManagementHubFindHandler // QuoteQuoteRequestStateChangeHandler sets the operation handler for the quote request state change operation QuoteQuoteRequestStateChangeHandler quote.QuoteRequestStateChangeHandler // 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) // PreServerShutdown is called before the HTTP(S) server is shutdown // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic PreServerShutdown func() // ServerShutdown is called when the HTTP(S) server is shut down and done // handling all active connections and does not accept connections any more ServerShutdown func() // Custom command line argument groups with their descriptions CommandLineOptionsGroups []swag.CommandLineOptionsGroup // User defined logger function. Logger func(string, ...interface{}) // contains filtered or unexported fields }
SonataAPI A set of APIs based on the LSO Reference Architecture for Serviceability (Address Validation, Site Queries, Product Offering Qualification) | Quoting | Product Inventory | Ordering | Trouble-ticketing Billing | Contract & Catalog
func NewSonataAPI ¶
NewSonataAPI creates a new Sonata instance
func (*SonataAPI) AddMiddlewareFor ¶
func (o *SonataAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*SonataAPI) AuthenticatorsFor ¶
func (o *SonataAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*SonataAPI) Authorizer ¶
func (o *SonataAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*SonataAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*SonataAPI) Context ¶
func (o *SonataAPI) Context() *middleware.Context
Context returns the middleware context for the sonata API
func (*SonataAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*SonataAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*SonataAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*SonataAPI) Init ¶
func (o *SonataAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*SonataAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*SonataAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*SonataAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*SonataAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*SonataAPI) Serve ¶
func (o *SonataAPI) Serve(builder middleware.Builder) http.Handler
Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
func (*SonataAPI) ServeErrorFor ¶
func (o *SonataAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*SonataAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*SonataAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type
func (*SonataAPI) UseSwaggerUI ¶
func (o *SonataAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs