Add initial Go server skeleton with HTTP handlers, middleware, job runner, and stubs
This commit is contained in:
65
internal/domain/domain.go
Normal file
65
internal/domain/domain.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type UUID string
|
||||
|
||||
type User struct {
|
||||
ID UUID `json:"id" db:"id"`
|
||||
Username string `json:"username" db:"username"`
|
||||
Password string `json:"-" db:"password_hash"`
|
||||
Role string `json:"role" db:"role"`
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type Role struct {
|
||||
Name string
|
||||
Permissions []string
|
||||
}
|
||||
|
||||
type Disk struct {
|
||||
ID UUID
|
||||
Path string
|
||||
Serial string
|
||||
Model string
|
||||
Size int64
|
||||
Health string
|
||||
}
|
||||
|
||||
type Pool struct {
|
||||
Name string
|
||||
GUID string
|
||||
Health string
|
||||
Capacity string
|
||||
}
|
||||
|
||||
type Dataset struct {
|
||||
Name string
|
||||
Pool string
|
||||
Type string
|
||||
Config map[string]string
|
||||
}
|
||||
|
||||
type Share struct {
|
||||
ID UUID
|
||||
Name string
|
||||
Path string
|
||||
Type string // nfs or smb
|
||||
}
|
||||
|
||||
type LUN struct {
|
||||
ID UUID
|
||||
TargetIQN string
|
||||
LUNID int
|
||||
Path string
|
||||
}
|
||||
|
||||
type Job struct {
|
||||
ID UUID
|
||||
Type string
|
||||
Status string
|
||||
Progress int
|
||||
Owner UUID
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user