Documentation
¶
Index ¶
- func GetOrgIDFromContext(c *gin.Context) (uint, bool)
- func GetUserIDFromContext(c *gin.Context) (uint, bool)
- func RequireOrgMembership(permService service.PermissionService) gin.HandlerFunc
- func RequireOrgPermission(permService service.PermissionService, permission string) gin.HandlerFunc
- type PlanHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOrgIDFromContext ¶
GetOrgIDFromContext retrieves the organization ID from Gin context
func GetUserIDFromContext ¶
GetUserIDFromContext retrieves the user ID from Gin context
func RequireOrgMembership ¶
func RequireOrgMembership(permService service.PermissionService) gin.HandlerFunc
RequireOrgMembership checks if the user is a member of the organization
func RequireOrgPermission ¶
func RequireOrgPermission(permService service.PermissionService, permission string) gin.HandlerFunc
RequireOrgPermission is a middleware that checks if the user has a specific permission in an organization
Types ¶
type PlanHandler ¶
type PlanHandler struct {
// contains filtered or unexported fields
}
func NewPlanHandler ¶
func NewPlanHandler(
planRepo interface {
List(ctx context.Context) ([]*domain.Plan, error)
GetByCode(ctx context.Context, code string) (*domain.Plan, error)
},
logger interface {
Info(msg string, args ...interface{})
Error(msg string, args ...interface{})
},
) *PlanHandler
NewPlanHandler creates a new plan handler
func (*PlanHandler) GetPlan ¶
func (h *PlanHandler) GetPlan(c *gin.Context)
GetPlan retrieves a plan by code GET /api/plans/:code
func (*PlanHandler) ListPlans ¶
func (h *PlanHandler) ListPlans(c *gin.Context)
ListPlans retrieves all active plans GET /api/plans
Click to show internal directories.
Click to hide internal directories.