34 lines
836 B
Go
34 lines
836 B
Go
package pipeline_api
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
get_runnerv1 "git.ohea.xyz/cursorius/server/proto/gen/get_runner/v1"
|
|
"git.ohea.xyz/cursorius/server/proto/gen/get_runner/v1/get_runnerv1connect"
|
|
"github.com/bufbuild/connect-go"
|
|
"github.com/op/go-logging"
|
|
)
|
|
|
|
var log = logging.MustGetLogger("cursorius-server")
|
|
|
|
type ApiServer struct{}
|
|
|
|
func (s *ApiServer) GetRunner(
|
|
ctx context.Context,
|
|
req *connect.Request[get_runnerv1.GetRunnerRequest],
|
|
) (*connect.Response[get_runnerv1.GetRunnerResponse], error) {
|
|
|
|
res := connect.NewResponse(&get_runnerv1.GetRunnerResponse{
|
|
RunnerId: 0,
|
|
})
|
|
res.Header().Set("GetRunner-Version", "v1")
|
|
return res, nil
|
|
}
|
|
|
|
func CreateHandler(mux *http.ServeMux) {
|
|
api_server := &ApiServer{}
|
|
path, handler := get_runnerv1connect.NewGetRunnerServiceHandler(api_server)
|
|
mux.Handle(path, handler)
|
|
}
|