mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-24 17:41:03 +01:00
- 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.
24 lines
1.1 KiB
Go
24 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Node struct {
|
|
any `collection:"nodes"`
|
|
BaseModel `bson:",inline"`
|
|
Key string `json:"key" bson:"key" description:"Key"`
|
|
Name string `json:"name" bson:"name" description:"Name"`
|
|
Ip string `json:"ip" bson:"ip" description:"IP"`
|
|
Mac string `json:"mac" bson:"mac" description:"MAC"`
|
|
Hostname string `json:"hostname" bson:"hostname" description:"Hostname"`
|
|
Description string `json:"description" bson:"description" description:"Description"`
|
|
IsMaster bool `json:"is_master" bson:"is_master" description:"Is master"`
|
|
Status string `json:"status" bson:"status" description:"Status"`
|
|
Enabled bool `json:"enabled" bson:"enabled" description:"Enabled"`
|
|
Active bool `json:"active" bson:"active" description:"Active"`
|
|
ActiveAt time.Time `json:"active_at" bson:"active_ts" description:"Active at"`
|
|
CurrentRunners int `json:"current_runners" bson:"current_runners" description:"Current runners"`
|
|
MaxRunners int `json:"max_runners" bson:"max_runners" description:"Max runners"`
|
|
}
|