api_catalog

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCatalogTokenRequired     = errors.New("catalog token required")
	ErrCatalogTokenUnavailable  = errors.New("catalog token unavailable")
	ErrCatalogAccessUnavailable = errors.New("catalog access unavailable")
)

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

type CatalogViewer

type CatalogViewer struct {
	UserID  uint
	IsAdmin bool
}

type EffectiveRequest

type EffectiveRequest struct {
	ServiceID uint `form:"service_id" binding:"required"`
	TokenID   uint `form:"token_id"`
}

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 (*Handler) ListRoutes

func (*Handler) ListServices

func (*Handler) ServiceDetail

func (h *Handler) ServiceDetail(c *app.Context, req ServiceDetailRequest) (ServiceResponse, error)

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 ServiceDetailRequest struct {
	ID      uint `form:"id" binding:"required"`
	TokenID uint `form:"token_id"`
}

type ServiceListRequest

type ServiceListRequest struct {
	api.PaginationQuery
	Search  string `form:"search"`
	TokenID uint   `form:"token_id"`
}

type ServiceResponse

type ServiceResponse struct {
	ID          uint   `json:"id"`
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL