projects

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	projectsSvc *projects.Service,
	usersSvc *users.Service,
	jwtSvc *jwt.Service,
	validate *validator.Validate,
) handler.Handler

NewHandler creates a new Handler instance with the given dependencies.

Types

type Handler

type Handler struct {
	handler.Base
	// contains filtered or unexported fields
}

Handler handles HTTP requests for project-related endpoints.

func (*Handler) Register

func (h *Handler) Register(r fiber.Router)

Register sets up the project routes on the given router. Routes are organized with appropriate middleware for authentication and authorization based on the operation.

type ProjectListResponse

type ProjectListResponse struct {
	Items []ProjectResponse `json:"items"`
	Total int               `json:"total" example:"1"`
}

ProjectListResponse represents the API response for a list of projects.

func NewProjectListResponse

func NewProjectListResponse(items []projects.Project, total int) ProjectListResponse

type ProjectRequest

type ProjectRequest struct {
	Name    string `json:"name"     validate:"required"     example:"Backend Service"`
	RepoURL string `json:"repo_url" validate:"required,url" example:"https://bitbucket.org/company/backend"`
}

ProjectRequest represents the request body for creating a new project.

type ProjectResponse

type ProjectResponse struct {
	ID        string `json:"id"         example:"backend-service"`
	Name      string `json:"name"       example:"Backend Service"`
	RepoURL   string `json:"repo_url"   example:"https://bitbucket.org/company/backend"`
	CreatedAt string `json:"created_at" example:"2026-04-01T08:00:00Z"`
	UpdatedAt string `json:"updated_at" example:"2026-04-02T09:00:00Z"`
}

ProjectResponse represents the API response for a single project.

func NewProjectResponse

func NewProjectResponse(p *projects.Project) ProjectResponse

type ProjectUpdateRequest

type ProjectUpdateRequest struct {
	Name    *string `json:"name,omitempty"     validate:"omitempty"     example:"Backend Service"`
	RepoURL *string `json:"repo_url,omitempty" validate:"omitempty,url" example:"https://bitbucket.org/company/backend"`
}

ProjectUpdateRequest represents the request body for updating a project. All fields are optional to support partial updates.

Jump to

Keyboard shortcuts

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