mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-01-31 11:46:16 +08:00
- Add scan-related models: ScanLog, ScanInputTarget, ScheduledScan, SubfinderProviderSettings - Add engine models: Wordlist, NucleiTemplateRepo - Add notification models: Notification, NotificationSettings - Add config model: BlacklistRule - Add statistics models: AssetStatistics, StatisticsHistory - Add auth models: User (auth_user), Session (django_session) - Add shopspring/decimal dependency for Vulnerability model - Update model_test.go with all 33 model table name tests - All tests passing
33 lines
1.2 KiB
Go
33 lines
1.2 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// WorkerNode represents a worker node for executing scans
|
|
type WorkerNode struct {
|
|
ID int `gorm:"primaryKey;autoIncrement" json:"id"`
|
|
Name string `gorm:"column:name;size:100;uniqueIndex" json:"name"`
|
|
IPAddress string `gorm:"column:ip_address;type:inet" json:"ipAddress"`
|
|
SSHPort int `gorm:"column:ssh_port;default:22" json:"sshPort"`
|
|
Username string `gorm:"column:username;size:50;default:'root'" json:"username"`
|
|
Password string `gorm:"column:password;size:200" json:"-"` // Hidden from JSON
|
|
IsLocal bool `gorm:"column:is_local;default:false" json:"isLocal"`
|
|
Status string `gorm:"column:status;size:20;default:'pending'" json:"status"`
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`
|
|
}
|
|
|
|
// TableName returns the table name for WorkerNode
|
|
func (WorkerNode) TableName() string {
|
|
return "worker_node"
|
|
}
|
|
|
|
// WorkerStatus constants
|
|
const (
|
|
WorkerStatusPending = "pending"
|
|
WorkerStatusConnected = "connected"
|
|
WorkerStatusDisconnected = "disconnected"
|
|
WorkerStatusError = "error"
|
|
)
|