chore(gRPC): register new runner

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-08-28 14:05:56 +08:00
committed by Jason Song
parent a3e9bbed25
commit 449388f3ab
7 changed files with 70 additions and 46 deletions

View File

@ -6,11 +6,19 @@ import (
runnerv1 "gitea.com/gitea/proto-go/runner/v1"
)
type Filter struct {
Kind string `json:"kind"`
Type string `json:"type"`
OS string `json:"os"`
Arch string `json:"arch"`
Capacity int `json:"capacity"`
}
// A Client manages communication with the runner.
type Client interface {
// Ping sends a ping message to the server to test connectivity.
Ping(ctx context.Context, machine string) error
// Request requests the next available build stage for execution.
Request(ctx context.Context) (*runnerv1.Stage, error)
// Register for new runner.
Register(ctx context.Context, args *runnerv1.RegisterRequest) (*runnerv1.Runner, error)
}