handler

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrgIDFromContext

func GetOrgIDFromContext(c *gin.Context) (uint, bool)

GetOrgIDFromContext retrieves the organization ID from Gin context

func GetUserIDFromContext

func GetUserIDFromContext(c *gin.Context) (uint, bool)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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