Created
November 9, 2024 13:57
-
-
Save jufianto/b3b586933ad1e14c85410d14d97acecb to your computer and use it in GitHub Desktop.
Init your golang gRPC Services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
option go_package = "github.com/jufianto/state-agent/agentsrv-proto"; | |
enum TaskStatus{ | |
UNKNOWN = 0; | |
PROCESSING = 1; | |
FAILED = 2; | |
SUCCESS = 3; | |
} | |
message TaskRequest{ | |
string task_id = 1; | |
string task_name = 2; | |
string task_url = 3; | |
} | |
message TaskResponse{ | |
string task_id = 1; | |
string task_result = 2; | |
TaskStatus task_status = 3; | |
} | |
message TaskListResponse{ | |
repeated TaskResponse tasks = 1; | |
} | |
message TaskListRequest{ | |
repeated string tasks_id = 1; | |
} | |
message TaskNotify{ | |
string task_id = 1; | |
TaskStatus task_status = 2; | |
} | |
message TaskStatusRequest { | |
string task_id = 1; | |
} | |
message TasksStatusResponse { | |
string task_id = 1; | |
TaskStatus task_status = 2; | |
} | |
service TaskService{ | |
rpc CreateTask(TaskRequest) returns (TaskResponse) {} | |
rpc ListTask(TaskListRequest) returns (TaskListResponse) {} | |
rpc StatusTask(TaskStatusRequest) returns (TasksStatusResponse){} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment