repository_manager_apis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package repository_manager_apis provides REST API for Git repository management

@title Git Repository Manager API @version 1.0 @description REST API for managing Git repositories, tags, and groups/namespaces @description @description This API provides comprehensive Git repository management capabilities including: @description - Repository CRUD operations with multi-level path support @description - Git tag management (lightweight and annotated tags) @description - Group/namespace management for organizing repositories @description @description All repository and group paths support multi-level hierarchies like "org/team/project"

@contact.name API Support @contact.url https://github.com/weedbox/git-modules

@license.name MIT @license.url https://opensource.org/licenses/MIT

@BasePath /apis/v1/repos

@schemes http https @produce json @consumes json

Index

Constants

View Source
const (
	ModuleName       = "RepositoryManagerAPIs"
	DefaultURLPrefix = "/apis/v1/repos"
)

Variables

This section is empty.

Functions

func Module

func Module(scope string) fx.Option

Types

type CreateRepositoryRequest

type CreateRepositoryRequest struct {
	Name        string `json:"name" binding:"required" example:"myorg/myrepo"`
	Description string `json:"description" example:"My awesome repository"`
	Type        string `json:"type" example:"repository" enums:"repository,group"`

} // @name CreateRepositoryRequest

CreateRepositoryRequest represents the request body for creating a repository or group @Description Request body for creating a repository or group

type CreateTagRequest

type CreateTagRequest struct {
	TagName    string `json:"tag_name" binding:"required" example:"v1.0.0"`
	CommitHash string `json:"commit_hash" example:"abc123def456"`
	Message    string `json:"message" example:"Release version 1.0.0"`
	Tagger     string `json:"tagger" example:"John Doe"`

} // @name CreateTagRequest

CreateTagRequest represents the request body for creating a tag @Description Request body for creating a Git tag

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error" example:"repository not found"`

} // @name ErrorResponse

ErrorResponse represents an error response @Description Error response body

type MessageResponse

type MessageResponse struct {
	Message string `json:"message" example:"Repository deleted successfully"`

} // @name MessageResponse

MessageResponse represents a success message response @Description Success message response

type MiddlewareConfig

type MiddlewareConfig struct {
	// Repository middlewares
	CreateRepository []gin.HandlerFunc
	ListRepositories []gin.HandlerFunc
	GetRepository    []gin.HandlerFunc
	DeleteRepository []gin.HandlerFunc

	// Tag middlewares
	CreateTag []gin.HandlerFunc
	ListTags  []gin.HandlerFunc
	GetTag    []gin.HandlerFunc
	DeleteTag []gin.HandlerFunc

	// Group middlewares
	CreateGroup []gin.HandlerFunc
	ListGroups  []gin.HandlerFunc
	GetGroup    []gin.HandlerFunc
	DeleteGroup []gin.HandlerFunc
}

func NewMiddlewareConfig

func NewMiddlewareConfig() MiddlewareConfig

func (*MiddlewareConfig) Use

func (mc *MiddlewareConfig) Use(fn gin.HandlerFunc)

type Params

type Params struct {
	fx.In

	Lifecycle         fx.Lifecycle
	Logger            *zap.Logger
	RepositoryManager *repository_manager.RepositoryManager
	HTTPServer        *http_server.HTTPServer
}

type RepositoryManagerAPIs

type RepositoryManagerAPIs struct {
	// contains filtered or unexported fields
}

func (*RepositoryManagerAPIs) SetupMiddleware

func (m *RepositoryManagerAPIs) SetupMiddleware(cfg MiddlewareConfig)

Jump to

Keyboard shortcuts

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