feat: 完整游戏运维功能
This commit is contained in:
@@ -9,7 +9,10 @@ import (
|
||||
"browser.local/platform/domain"
|
||||
)
|
||||
|
||||
const MaxArtifactChunkBytes = 1024 * 1024
|
||||
const (
|
||||
MaxArtifactChunkBytes = 1024 * 1024
|
||||
MaxArtifactBytes = int64(512 * 1024 * 1024)
|
||||
)
|
||||
|
||||
func ValidateArtifactTransferOpen(open domain.ArtifactTransferOpen) error {
|
||||
var violations []string
|
||||
@@ -31,6 +34,9 @@ func ValidateArtifactTransferOpen(open domain.ArtifactTransferOpen) error {
|
||||
if open.SizeBytes <= 0 {
|
||||
violations = append(violations, "sizeBytes must be positive")
|
||||
}
|
||||
if open.SizeBytes > MaxArtifactBytes {
|
||||
violations = append(violations, fmt.Sprintf("sizeBytes must not exceed %d", MaxArtifactBytes))
|
||||
}
|
||||
if open.ChunkSizeBytes <= 0 {
|
||||
violations = append(violations, "chunkSizeBytes must be positive")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user