Files
crawlab/core/models/models/git.go
Marvin Zhang 931a36c8bf refactor: enhance parameter descriptions and standardize model fields
- Added descriptive annotations to various parameters across controllers to improve API documentation clarity.
- Standardized field definitions in models by including descriptions for better understanding of their purpose.
- Updated validation patterns for ID fields to ensure consistency and improve data integrity.
- Enhanced overall code readability and maintainability by aligning naming conventions and adding necessary comments.
2025-03-19 13:39:02 +08:00

28 lines
1.2 KiB
Go

package models
import (
"time"
"github.com/crawlab-team/crawlab/vcs"
)
type Git struct {
any `collection:"gits"`
BaseModel `bson:",inline"`
Url string `json:"url" bson:"url" description:"URL"`
Name string `json:"name" bson:"name" description:"Name"`
AuthType string `json:"auth_type" bson:"auth_type" description:"Auth type"`
Username string `json:"username" bson:"username" description:"Username"`
Password string `json:"password" bson:"password" description:"Password"`
CurrentBranch string `json:"current_branch" bson:"current_branch" description:"Current branch"`
Status string `json:"status" bson:"status" description:"Status"`
Error string `json:"error" bson:"error" description:"Error"`
Spiders []Spider `json:"spiders,omitempty" bson:"-" binding:"-"`
Refs []vcs.GitRef `json:"refs" bson:"refs" description:"Refs"`
RefsUpdatedAt time.Time `json:"refs_updated_at" bson:"refs_updated_at" description:"Refs updated at"`
CloneLogs []string `json:"clone_logs,omitempty" bson:"clone_logs" description:"Clone logs"`
// settings
AutoPull bool `json:"auto_pull" bson:"auto_pull" description:"Auto pull"`
}