1Panel/backend/app/dto/container.go

69 lines
1.9 KiB
Go
Raw Normal View History

package dto
2022-10-11 14:20:51 +08:00
import "time"
type PageContainer struct {
PageInfo
Status string `json:"status" validate:"required,oneof=all running"`
}
type ContainerInfo struct {
ContainerID string `json:"containerID"`
Name string `json:"name"`
ImageId string `json:"imageID"`
ImageName string `json:"imageName"`
CreateTime string `json:"createTime"`
State string `json:"state"`
RunTime string `json:"runTime"`
}
type ContainerLog struct {
ContainerID string `json:"containerID" validate:"required"`
Mode string `json:"mode" validate:"required"`
}
type ContainerOperation struct {
ContainerID string `json:"containerID" validate:"required"`
Operation string `json:"operation" validate:"required,oneof=start stop reStart kill pause unPause reName remove"`
NewName string `json:"newName"`
}
2022-10-11 14:20:51 +08:00
type Network struct {
2022-10-11 17:46:52 +08:00
ID string `json:"id"`
Name string `json:"name"`
Labels []string `json:"labels"`
Driver string `json:"driver"`
IPAMDriver string `json:"ipamDriver"`
Subnet string `json:"subnet"`
Gateway string `json:"gateway"`
CreatedAt time.Time `json:"createdAt"`
Attachable bool `json:"attachable"`
2022-10-11 14:20:51 +08:00
}
type NetworkCreat struct {
2022-10-11 17:46:52 +08:00
Name string `json:"name"`
Driver string `json:"driver"`
Options []string `json:"options"`
Subnet string `json:"subnet"`
Gateway string `json:"gateway"`
IPRange string `json:"ipRange"`
Labels []string `json:"labels"`
2022-10-11 14:20:51 +08:00
}
type Volume struct {
Name string `json:"name"`
Labels []string `json:"labels"`
Driver string `json:"driver"`
Mountpoint string `json:"mountpoint"`
CreatedAt time.Time `json:"createdAt"`
}
type VolumeCreat struct {
Name string `json:"name"`
Driver string `json:"driver"`
Options []string `json:"options"`
Labels []string `json:"labels"`
}
type BatchDelete struct {
Ids []string `json:"ids" validate:"required"`
}