Phase4
This commit is contained in:
@@ -40,6 +40,10 @@ const (
|
||||
TypeServerFilesWrite MessageType = "server.files.write"
|
||||
TypeServerFilesUploadDone MessageType = "server.files.upload.complete"
|
||||
TypeServerWorldValidate MessageType = "server.world.validate"
|
||||
TypeServerWorldArchive MessageType = "server.world.archive"
|
||||
TypeServerWorldReplace MessageType = "server.world.replace"
|
||||
TypeServerStorageUpload MessageType = "server.storage.upload"
|
||||
TypeServerStorageDownload MessageType = "server.storage.download"
|
||||
TypeServerMetricsSub MessageType = "server.metrics.subscribe"
|
||||
TypeServerLogsSubscribe MessageType = "server.logs.subscribe"
|
||||
)
|
||||
@@ -72,6 +76,10 @@ var controlToAgentTypes = map[MessageType]struct{}{
|
||||
TypeServerFilesWrite: {},
|
||||
TypeServerFilesUploadDone: {},
|
||||
TypeServerWorldValidate: {},
|
||||
TypeServerWorldArchive: {},
|
||||
TypeServerWorldReplace: {},
|
||||
TypeServerStorageUpload: {},
|
||||
TypeServerStorageDownload: {},
|
||||
TypeServerMetricsSub: {},
|
||||
TypeServerLogsSubscribe: {},
|
||||
}
|
||||
@@ -178,6 +186,40 @@ type ServerFilesWritePayload struct {
|
||||
Create bool `json:"create"`
|
||||
}
|
||||
|
||||
// ServerWorldValidatePayload validates a Minecraft world directory.
|
||||
type ServerWorldValidatePayload struct {
|
||||
OperationMeta
|
||||
WorldName string `json:"worldName"`
|
||||
}
|
||||
|
||||
// ServerWorldArchivePayload archives a world directory.
|
||||
type ServerWorldArchivePayload struct {
|
||||
OperationMeta
|
||||
WorldName string `json:"worldName"`
|
||||
ArchiveID string `json:"archiveId"`
|
||||
}
|
||||
|
||||
// ServerStorageUploadPayload uploads a local file to a presigned URL.
|
||||
type ServerStorageUploadPayload struct {
|
||||
OperationMeta
|
||||
LocalPath string `json:"localPath"`
|
||||
UploadURL string `json:"uploadUrl"`
|
||||
}
|
||||
|
||||
// ServerStorageDownloadPayload downloads a remote file to a local path.
|
||||
type ServerStorageDownloadPayload struct {
|
||||
OperationMeta
|
||||
DownloadURL string `json:"downloadUrl"`
|
||||
LocalPath string `json:"localPath"`
|
||||
}
|
||||
|
||||
// ServerWorldReplacePayload replaces a world from a local archive.
|
||||
type ServerWorldReplacePayload struct {
|
||||
OperationMeta
|
||||
WorldName string `json:"worldName"`
|
||||
ArchivePath string `json:"archivePath"`
|
||||
}
|
||||
|
||||
// FileEntry describes a file or directory in a list response.
|
||||
type FileEntry struct {
|
||||
Name string `json:"name"`
|
||||
|
||||
Reference in New Issue
Block a user