mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Use protobuf Enum exclusively for message sent from Client (#2644)
This commit is contained in:
parent
06e9a5e15c
commit
b56fa7c508
|
@ -4,5 +4,5 @@ defmodule LivebookProto.AppDeploymentStatus do
|
|||
field :id, 1, type: :string
|
||||
field :deployment_group_id, 2, type: :string, json_name: "deploymentGroupId"
|
||||
field :version, 3, type: :string
|
||||
field :status, 4, type: :string
|
||||
field :status, 4, type: LivebookProto.AppDeploymentStatusType, enum: true
|
||||
end
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
defmodule LivebookProto.AppDeploymentStatusType do
|
||||
use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
|
||||
|
||||
field :connecting, 0
|
||||
field :preparing, 1
|
||||
field :available, 2
|
||||
field :deactivated, 99
|
||||
end
|
|
@ -159,11 +159,25 @@ message Agent {
|
|||
string deployment_group_id = 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* We're only using Enum in this case because
|
||||
* the Client is the source of the information,
|
||||
* and the Server will always be up-to-date.
|
||||
*
|
||||
* Otherwise, it shouldn't be used.
|
||||
*/
|
||||
enum AppDeploymentStatusType {
|
||||
connecting = 0;
|
||||
preparing = 1;
|
||||
available = 2;
|
||||
deactivated = 4;
|
||||
}
|
||||
|
||||
message AppDeploymentStatus {
|
||||
string id = 1;
|
||||
string deployment_group_id = 2;
|
||||
string version = 3;
|
||||
string status = 4;
|
||||
AppDeploymentStatusType status = 4;
|
||||
}
|
||||
|
||||
message AppDeploymentStatusReport {
|
||||
|
|
Loading…
Reference in a new issue