Documentation ¶
Index ¶
- func NewHandler(handler MetadataHandler, middlewares []mux.MiddlewareFunc) http.Handler
- func NewHealthCheckHandler() http.Handler
- func NewStaticFileHandler(path string) http.Handler
- type API
- type BasicAuth
- type CertificateGen
- type CreateServiceResponse
- type Credentials
- type DocsObject
- type Documentation
- type ErrorHandler
- type Events
- type MetadataHandler
- type Oauth
- type RedirectionHandler
- type Service
- type ServiceDetails
- type ServiceDetailsValidator
- type ServiceDetailsValidatorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(handler MetadataHandler, middlewares []mux.MiddlewareFunc) http.Handler
func NewHealthCheckHandler ¶
NewHealthCheckHandler creates handler for performing health check
func NewStaticFileHandler ¶
NewStaticFileHandler creates handler for returning API spec
Types ¶
type API ¶
type API struct { TargetUrl string `json:"targetUrl" valid:"url,required~targetUrl field cannot be empty."` Credentials *Credentials `json:"credentials,omitempty"` Spec json.RawMessage `json:"spec,omitempty"` SpecificationUrl string `json:"specificationUrl,omitempty"` ApiType string `json:"apiType,omitempty"` }
func (API) MarshalJSON ¶
type CertificateGen ¶
type CertificateGen struct {
CommonName string `json:"commonName"`
}
type CreateServiceResponse ¶
type CreateServiceResponse struct {
ID string `json:"id"`
}
type Credentials ¶
type Credentials struct { Oauth *Oauth `json:"oauth,omitempty"` Basic *BasicAuth `json:"basic,omitempty"` CertificateGen *CertificateGen `json:"certificateGen,omitempty"` }
type DocsObject ¶
type Documentation ¶
type Documentation struct { DisplayName string `json:"displayName" valid:"required~displayName field cannot be empty in documentation"` Description string `json:"description" valid:"required~description field cannot be empty in documentation"` Type string `json:"type" valid:"required~type field cannot be empty in documentation"` Tags []string `json:"tags,omitempty"` Docs []DocsObject `json:"docs,omitempty"` }
type ErrorHandler ¶
func NewErrorHandler ¶
func NewErrorHandler(code int, message string) *ErrorHandler
func (*ErrorHandler) ServeHTTP ¶
func (eh *ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Events ¶
type Events struct {
Spec json.RawMessage `json:"spec" valid:"required~spec cannot be empty"`
}
type MetadataHandler ¶
type MetadataHandler interface { CreateService(w http.ResponseWriter, r *http.Request) GetService(w http.ResponseWriter, r *http.Request) GetServices(w http.ResponseWriter, r *http.Request) UpdateService(w http.ResponseWriter, r *http.Request) DeleteService(w http.ResponseWriter, r *http.Request) }
func NewInvalidStateMetadataHandler ¶
func NewInvalidStateMetadataHandler(message string) MetadataHandler
func NewMetadataHandler ¶
func NewMetadataHandler(validator ServiceDetailsValidator, serviceDefinitionService metadata.ServiceDefinitionService, detailedErrorResponse bool) MetadataHandler
type RedirectionHandler ¶
type RedirectionHandler interface {
Redirect(w http.ResponseWriter, r *http.Request)
}
func NewRedirectionHandler ¶
func NewRedirectionHandler(destination string, status int) RedirectionHandler
NewRedirectionHandler creates handler for redirection that replaces path variables
type ServiceDetails ¶
type ServiceDetails struct { Provider string `json:"provider" valid:"required~Provider field cannot be empty."` Name string `json:"name" valid:"required~Name field cannot be empty."` Description string `json:"description" valid:"required~Description field cannot be empty."` ShortDescription string `json:"shortDescription,omitempty"` Identifier string `json:"identifier,omitempty"` Labels *map[string]string `json:"labels,omitempty"` Api *API `json:"api,omitempty"` Events *Events `json:"events,omitempty"` Documentation *Documentation `json:"documentation,omitempty"` }
type ServiceDetailsValidator ¶
type ServiceDetailsValidator interface {
Validate(details ServiceDetails) apperrors.AppError
}
func NewServiceDetailsValidator ¶
func NewServiceDetailsValidator() ServiceDetailsValidator
type ServiceDetailsValidatorFunc ¶
type ServiceDetailsValidatorFunc func(details ServiceDetails) apperrors.AppError
func (ServiceDetailsValidatorFunc) Validate ¶
func (f ServiceDetailsValidatorFunc) Validate(details ServiceDetails) apperrors.AppError
Click to show internal directories.
Click to hide internal directories.