Documentation
¶
Index ¶
- Variables
- type CatalogRequestScope
- type CatalogRequestScopeFinder
- type CatalogViewer
- type EffectiveRequest
- type Handler
- func (h *Handler) Effective(c *app.Context, req EffectiveRequest) (apiaccessgrant.EffectiveAccess, error)
- func (h *Handler) ListRoutes(c *app.Context, req RouteListRequest) (api.PaginatedResponse[RouteResponse], error)
- func (h *Handler) ListServices(c *app.Context, req ServiceListRequest) (api.PaginatedResponse[ServiceResponse], error)
- func (h *Handler) OpenAPI(c *app.Context, req OpenAPIRequest) (OpenAPIResponse, error)
- func (h *Handler) ServiceDetail(c *app.Context, req ServiceDetailRequest) (ServiceResponse, error)
- type OpenAPIRequest
- type OpenAPIResponse
- type RouteListRequest
- type RouteResponse
- type ServiceDetailRequest
- type ServiceListRequest
- type ServiceResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCatalogTokenRequired = errors.New("catalog token required") )
Functions ¶
This section is empty.
Types ¶
type CatalogRequestScope ¶
type CatalogRequestScope struct {
AdminAll bool
TokenID uint
ServiceWideIDs []uint
VisibleServiceIDs []uint
RouteIDs []uint
// contains filtered or unexported fields
}
func (CatalogRequestScope) RouteIDsFor ¶
func (s CatalogRequestScope) RouteIDsFor(serviceID uint) (*[]uint, bool)
func (CatalogRequestScope) ServiceIDs ¶
func (s CatalogRequestScope) ServiceIDs() *[]uint
type CatalogRequestScopeFinder ¶
type CatalogRequestScopeFinder struct {
// contains filtered or unexported fields
}
func NewCatalogRequestScopeFinder ¶
func NewCatalogRequestScopeFinder(ctx dao.Context) *CatalogRequestScopeFinder
func (*CatalogRequestScopeFinder) Find ¶
func (f *CatalogRequestScopeFinder) Find(ctx context.Context, viewer CatalogViewer, tokenID uint) (CatalogRequestScope, error)
type CatalogViewer ¶
type EffectiveRequest ¶
type Handler ¶
type Handler struct{ App app.Application }
Handler serves the authenticated user-facing API catalog. It deliberately projects safe response DTOs instead of returning management models.
func (*Handler) Effective ¶
func (h *Handler) Effective(c *app.Context, req EffectiveRequest) (apiaccessgrant.EffectiveAccess, error)
func (*Handler) ListRoutes ¶
func (h *Handler) ListRoutes(c *app.Context, req RouteListRequest) (api.PaginatedResponse[RouteResponse], error)
func (*Handler) ListServices ¶
func (h *Handler) ListServices(c *app.Context, req ServiceListRequest) (api.PaginatedResponse[ServiceResponse], error)
func (*Handler) OpenAPI ¶ added in v0.0.18
func (h *Handler) OpenAPI(c *app.Context, req OpenAPIRequest) (OpenAPIResponse, error)
func (*Handler) ServiceDetail ¶
func (h *Handler) ServiceDetail(c *app.Context, req ServiceDetailRequest) (ServiceResponse, error)
type OpenAPIRequest ¶ added in v0.0.18
type OpenAPIResponse ¶ added in v0.0.18
type OpenAPIResponse struct {
Document json.RawMessage `json:"document"`
}
OpenAPIResponse deliberately contains only the standard exported document. The management document snapshot includes route and persistence details that do not belong to the authenticated catalog boundary.
type RouteListRequest ¶
type RouteListRequest struct {
api.PaginationQuery
ServiceID uint `form:"service_id" binding:"required"`
Search string `form:"search"`
TokenID uint `form:"token_id"`
}
type RouteResponse ¶
type RouteResponse struct {
ID uint `json:"id"`
APIServiceID uint `json:"api_service_id"`
Slug string `json:"slug"`
Protocols []models.APIProtocol `json:"protocols"`
AllowedMethods []string `json:"allowed_methods"`
WebSocketSubprotocols []string `json:"websocket_subprotocols"`
ExampleRequest models.APIRequestExample `json:"example_request"`
}
type ServiceDetailRequest ¶
type ServiceListRequest ¶
type ServiceListRequest struct {
api.PaginationQuery
Search string `form:"search"`
TokenID uint `form:"token_id"`
}
Click to show internal directories.
Click to hide internal directories.