// SPDX-License-Identifier: MIT // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: ermite/run.proto package ermiteconnect import ( ermite "bnema.dev/ermite-api/gen/ermite" connect "connectrpc.com/connect" context "context" errors "errors" http "net/http" strings "strings" ) // This is a compile-time assertion to ensure that this generated file and the connect package are // compatible. If you get a compiler error that this constant is not defined, this code was // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. const _ = connect.IsAtLeastVersion1_13_0 const ( // RunServiceName is the fully-qualified name of the RunService service. RunServiceName = "ermite.RunService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're // exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. // // Note that these are different from the fully-qualified method names used by // google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to // reflection-formatted method names, remove the leading slash and convert the remaining slash to a // period. const ( // RunServiceListRunsProcedure is the fully-qualified name of the RunService's ListRuns RPC. RunServiceListRunsProcedure = "/ermite.RunService/ListRuns" // RunServiceGetRunProcedure is the fully-qualified name of the RunService's GetRun RPC. RunServiceGetRunProcedure = "/ermite.RunService/GetRun" // RunServiceGetJobProcedure is the fully-qualified name of the RunService's GetJob RPC. RunServiceGetJobProcedure = "/ermite.RunService/GetJob" // RunServiceListAnnotationsProcedure is the fully-qualified name of the RunService's // ListAnnotations RPC. RunServiceListAnnotationsProcedure = "/ermite.RunService/ListAnnotations" // RunServiceGetStepSummariesProcedure is the fully-qualified name of the RunService's // GetStepSummaries RPC. RunServiceGetStepSummariesProcedure = "/ermite.RunService/GetStepSummaries" // RunServiceGetJobLogProcedure is the fully-qualified name of the RunService's GetJobLog RPC. RunServiceGetJobLogProcedure = "/ermite.RunService/GetJobLog" // RunServiceCancelRunProcedure is the fully-qualified name of the RunService's CancelRun RPC. RunServiceCancelRunProcedure = "/ermite.RunService/CancelRun" // RunServiceRerunRunProcedure is the fully-qualified name of the RunService's RerunRun RPC. RunServiceRerunRunProcedure = "/ermite.RunService/RerunRun" // RunServiceDispatchWorkflowProcedure is the fully-qualified name of the RunService's // DispatchWorkflow RPC. RunServiceDispatchWorkflowProcedure = "/ermite.RunService/DispatchWorkflow" // RunServiceListChecksProcedure is the fully-qualified name of the RunService's ListChecks RPC. RunServiceListChecksProcedure = "/ermite.RunService/ListChecks" // RunServiceListRunnersProcedure is the fully-qualified name of the RunService's ListRunners RPC. RunServiceListRunnersProcedure = "/ermite.RunService/ListRunners" // RunServiceRemoveRunnerProcedure is the fully-qualified name of the RunService's RemoveRunner RPC. RunServiceRemoveRunnerProcedure = "/ermite.RunService/RemoveRunner" ) // RunServiceClient is a client for the ermite.RunService service. type RunServiceClient interface { // ListRuns lists the runs of a repository, highest id (newest) first. Each // run is described by its latest attempt. The filters narrow the result; a // server without the feature "ci.runs.filters" ignores them and returns // every run, so a client that needs them checks the feature. Fails with // invalid_argument if a filter is malformed. ListRuns(context.Context, *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) // GetRun returns a run with its jobs and their steps, for the latest attempt // or for the one asked. Fails with not_found if the run or the attempt does // not exist. GetRun(context.Context, *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) // GetJob returns one job with its steps. Fails with not_found if the job // or the attempt does not exist. GetJob(context.Context, *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) // ListAnnotations lists the annotations of a run attempt, optionally of one // job, ordered by job (as in GetRun), step number, then the order in which // the step produced them. For each job it gives the annotations of the // attempt in which that job executed (RunJob.attempt), which is lower than // the attempt of the run for a job kept by a re-run of failed jobs only. Needs the same access as GetRun. Returns at most // 1,000 annotations (truncated tells). A run without annotations gives an // empty list. Only servers with the feature "ci.annotations" implement it // (unimplemented otherwise). Fails with not_found if the run, the attempt or // the job does not exist, or if the job is not a job of the run. ListAnnotations(context.Context, *connect.Request[ermite.ListAnnotationsRequest]) (*connect.Response[ermite.ListAnnotationsResponse], error) // GetStepSummaries returns the job summaries (the Markdown written to // GITHUB_STEP_SUMMARY) of the steps of a job that have one, ordered by step // number. Like GitHub, it returns at most 20 summaries per job: the first 20 // steps that have one, in step order; truncated says there are more. Needs // the same access as GetJob. Only servers with the feature // "ci.summaries" implement it (unimplemented otherwise). A job without // summaries gives an empty list. Fails with not_found if the job or the // attempt does not exist. GetStepSummaries(context.Context, *connect.Request[ermite.GetStepSummariesRequest]) (*connect.Response[ermite.GetStepSummariesResponse], error) // GetJobLog streams the lines of the log of a job, from a line number. The // server sends them in order in messages of at most 1,000 lines and 64 KiB of // text each. // // Without follow, the stream ends after the last line stored when the call // was made. With follow, it goes on as lines arrive, with at most 1 second of // delay after the runner's AppendLog, and ends without error once the job has // completed and all its lines were sent; on a completed job follow changes // nothing. A client that loses the stream calls again with the offset after // the last line it received. The client may cancel at any time. // // Fails with not_found if the job, the attempt or its log does not exist (the // log is removed by the retention sweep, and a queued job has none: with // follow, the call waits for the first line instead), with out_of_range if // offset is beyond the end of the log of a job without follow, and with // resource_exhausted when there are too many concurrent log streams, in // total or from one client. Like Watch, a stream ends with unauthenticated // when the token was revoked or expired. GetJobLog(context.Context, *connect.Request[ermite.GetJobLogRequest]) (*connect.ServerStreamForClient[ermite.GetJobLogResponse], error) // CancelRun asks to cancel the latest attempt of a run. Needs the ci:write // scope. Jobs that have not started are cancelled at once; jobs in progress // get a CANCEL_REASON_USER request through WatchJob, and the run completes // when they have ended, so the returned run may still be IN_PROGRESS. // Cancelling a run that already has a cancellation requested succeeds and // changes nothing. Fails with failed_precondition if the run has completed. CancelRun(context.Context, *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) // RerunRun starts a new attempt of a completed run: same run id and number, // attempt + 1, same commit and same workflow file as at the original run (the // file of the repository is not read again). Needs the ci:write scope. Fails // with failed_precondition if the latest attempt has not completed, or if // failed_only is set and no job failed. The new attempt is returned QUEUED. RerunRun(context.Context, *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) // DispatchWorkflow starts a run of a workflow file by hand, like `gh // workflow run` and GitHub's "workflow_dispatch" event. Needs the ci:write // scope on the repository. The workflow is read at ref and must have // "workflow_dispatch" among its events. The run has event // "workflow_dispatch", ref and the commit ref points to, and the caller as // actor; it is trusted when the caller is the owner and not trusted when the // caller is a token limited to branches. The run is returned QUEUED, before // any job has been given to a runner. Only servers with the feature // "ci.dispatch" implement it (unimplemented otherwise). Fails with // not_found if the repository, the workflow file or ref does not exist, // with failed_precondition if the workflow does not declare // "workflow_dispatch", and with invalid_argument if an input is unknown, is // missing while required without default, or has a value of the wrong type // or outside its choices, or if the workflow file is not valid. DispatchWorkflow(context.Context, *connect.Request[ermite.DispatchWorkflowRequest]) (*connect.Response[ermite.DispatchWorkflowResponse], error) // ListChecks lists the checks of a commit: for each job of each run on that // sha, the one of the latest attempt, ordered by creation time then name. // A commit without a run has no check: the list is empty, which is not an // error, and the server does not verify that the commit exists. Returns at // most 1,000 checks (truncated tells). ListChecks(context.Context, *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) // ListRunners lists the registered runners, ordered by name. Needs the // runner:register scope. ListRunners(context.Context, *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) // RemoveRunner removes a runner: its runner token stops working at once (a // FetchJob in progress ends with unauthenticated) and it no longer gets // jobs. A job it is running is not affected: it ends normally, or fails as // a lost runner without heartbeats. Needs the runner:register scope. Fails // with not_found if the id is unknown. RemoveRunner(context.Context, *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) } // NewRunServiceClient constructs a client for the ermite.RunService service. By default, it uses // the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends // uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or // connect.WithGRPCWeb() options. // // The URL supplied here should be the base URL for the Connect or gRPC server (for example, // http://api.acme.com or https://acme.com/grpc). func NewRunServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RunServiceClient { baseURL = strings.TrimRight(baseURL, "/") runServiceMethods := ermite.File_ermite_run_proto.Services().ByName("RunService").Methods() return &runServiceClient{ listRuns: connect.NewClient[ermite.ListRunsRequest, ermite.ListRunsResponse]( httpClient, baseURL+RunServiceListRunsProcedure, connect.WithSchema(runServiceMethods.ByName("ListRuns")), connect.WithClientOptions(opts...), ), getRun: connect.NewClient[ermite.GetRunRequest, ermite.GetRunResponse]( httpClient, baseURL+RunServiceGetRunProcedure, connect.WithSchema(runServiceMethods.ByName("GetRun")), connect.WithClientOptions(opts...), ), getJob: connect.NewClient[ermite.GetJobRequest, ermite.GetJobResponse]( httpClient, baseURL+RunServiceGetJobProcedure, connect.WithSchema(runServiceMethods.ByName("GetJob")), connect.WithClientOptions(opts...), ), listAnnotations: connect.NewClient[ermite.ListAnnotationsRequest, ermite.ListAnnotationsResponse]( httpClient, baseURL+RunServiceListAnnotationsProcedure, connect.WithSchema(runServiceMethods.ByName("ListAnnotations")), connect.WithClientOptions(opts...), ), getStepSummaries: connect.NewClient[ermite.GetStepSummariesRequest, ermite.GetStepSummariesResponse]( httpClient, baseURL+RunServiceGetStepSummariesProcedure, connect.WithSchema(runServiceMethods.ByName("GetStepSummaries")), connect.WithClientOptions(opts...), ), getJobLog: connect.NewClient[ermite.GetJobLogRequest, ermite.GetJobLogResponse]( httpClient, baseURL+RunServiceGetJobLogProcedure, connect.WithSchema(runServiceMethods.ByName("GetJobLog")), connect.WithClientOptions(opts...), ), cancelRun: connect.NewClient[ermite.CancelRunRequest, ermite.CancelRunResponse]( httpClient, baseURL+RunServiceCancelRunProcedure, connect.WithSchema(runServiceMethods.ByName("CancelRun")), connect.WithClientOptions(opts...), ), rerunRun: connect.NewClient[ermite.RerunRunRequest, ermite.RerunRunResponse]( httpClient, baseURL+RunServiceRerunRunProcedure, connect.WithSchema(runServiceMethods.ByName("RerunRun")), connect.WithClientOptions(opts...), ), dispatchWorkflow: connect.NewClient[ermite.DispatchWorkflowRequest, ermite.DispatchWorkflowResponse]( httpClient, baseURL+RunServiceDispatchWorkflowProcedure, connect.WithSchema(runServiceMethods.ByName("DispatchWorkflow")), connect.WithClientOptions(opts...), ), listChecks: connect.NewClient[ermite.ListChecksRequest, ermite.ListChecksResponse]( httpClient, baseURL+RunServiceListChecksProcedure, connect.WithSchema(runServiceMethods.ByName("ListChecks")), connect.WithClientOptions(opts...), ), listRunners: connect.NewClient[ermite.ListRunnersRequest, ermite.ListRunnersResponse]( httpClient, baseURL+RunServiceListRunnersProcedure, connect.WithSchema(runServiceMethods.ByName("ListRunners")), connect.WithClientOptions(opts...), ), removeRunner: connect.NewClient[ermite.RemoveRunnerRequest, ermite.RemoveRunnerResponse]( httpClient, baseURL+RunServiceRemoveRunnerProcedure, connect.WithSchema(runServiceMethods.ByName("RemoveRunner")), connect.WithClientOptions(opts...), ), } } // runServiceClient implements RunServiceClient. type runServiceClient struct { listRuns *connect.Client[ermite.ListRunsRequest, ermite.ListRunsResponse] getRun *connect.Client[ermite.GetRunRequest, ermite.GetRunResponse] getJob *connect.Client[ermite.GetJobRequest, ermite.GetJobResponse] listAnnotations *connect.Client[ermite.ListAnnotationsRequest, ermite.ListAnnotationsResponse] getStepSummaries *connect.Client[ermite.GetStepSummariesRequest, ermite.GetStepSummariesResponse] getJobLog *connect.Client[ermite.GetJobLogRequest, ermite.GetJobLogResponse] cancelRun *connect.Client[ermite.CancelRunRequest, ermite.CancelRunResponse] rerunRun *connect.Client[ermite.RerunRunRequest, ermite.RerunRunResponse] dispatchWorkflow *connect.Client[ermite.DispatchWorkflowRequest, ermite.DispatchWorkflowResponse] listChecks *connect.Client[ermite.ListChecksRequest, ermite.ListChecksResponse] listRunners *connect.Client[ermite.ListRunnersRequest, ermite.ListRunnersResponse] removeRunner *connect.Client[ermite.RemoveRunnerRequest, ermite.RemoveRunnerResponse] } // ListRuns calls ermite.RunService.ListRuns. func (c *runServiceClient) ListRuns(ctx context.Context, req *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) { return c.listRuns.CallUnary(ctx, req) } // GetRun calls ermite.RunService.GetRun. func (c *runServiceClient) GetRun(ctx context.Context, req *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) { return c.getRun.CallUnary(ctx, req) } // GetJob calls ermite.RunService.GetJob. func (c *runServiceClient) GetJob(ctx context.Context, req *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) { return c.getJob.CallUnary(ctx, req) } // ListAnnotations calls ermite.RunService.ListAnnotations. func (c *runServiceClient) ListAnnotations(ctx context.Context, req *connect.Request[ermite.ListAnnotationsRequest]) (*connect.Response[ermite.ListAnnotationsResponse], error) { return c.listAnnotations.CallUnary(ctx, req) } // GetStepSummaries calls ermite.RunService.GetStepSummaries. func (c *runServiceClient) GetStepSummaries(ctx context.Context, req *connect.Request[ermite.GetStepSummariesRequest]) (*connect.Response[ermite.GetStepSummariesResponse], error) { return c.getStepSummaries.CallUnary(ctx, req) } // GetJobLog calls ermite.RunService.GetJobLog. func (c *runServiceClient) GetJobLog(ctx context.Context, req *connect.Request[ermite.GetJobLogRequest]) (*connect.ServerStreamForClient[ermite.GetJobLogResponse], error) { return c.getJobLog.CallServerStream(ctx, req) } // CancelRun calls ermite.RunService.CancelRun. func (c *runServiceClient) CancelRun(ctx context.Context, req *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) { return c.cancelRun.CallUnary(ctx, req) } // RerunRun calls ermite.RunService.RerunRun. func (c *runServiceClient) RerunRun(ctx context.Context, req *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) { return c.rerunRun.CallUnary(ctx, req) } // DispatchWorkflow calls ermite.RunService.DispatchWorkflow. func (c *runServiceClient) DispatchWorkflow(ctx context.Context, req *connect.Request[ermite.DispatchWorkflowRequest]) (*connect.Response[ermite.DispatchWorkflowResponse], error) { return c.dispatchWorkflow.CallUnary(ctx, req) } // ListChecks calls ermite.RunService.ListChecks. func (c *runServiceClient) ListChecks(ctx context.Context, req *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) { return c.listChecks.CallUnary(ctx, req) } // ListRunners calls ermite.RunService.ListRunners. func (c *runServiceClient) ListRunners(ctx context.Context, req *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) { return c.listRunners.CallUnary(ctx, req) } // RemoveRunner calls ermite.RunService.RemoveRunner. func (c *runServiceClient) RemoveRunner(ctx context.Context, req *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) { return c.removeRunner.CallUnary(ctx, req) } // RunServiceHandler is an implementation of the ermite.RunService service. type RunServiceHandler interface { // ListRuns lists the runs of a repository, highest id (newest) first. Each // run is described by its latest attempt. The filters narrow the result; a // server without the feature "ci.runs.filters" ignores them and returns // every run, so a client that needs them checks the feature. Fails with // invalid_argument if a filter is malformed. ListRuns(context.Context, *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) // GetRun returns a run with its jobs and their steps, for the latest attempt // or for the one asked. Fails with not_found if the run or the attempt does // not exist. GetRun(context.Context, *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) // GetJob returns one job with its steps. Fails with not_found if the job // or the attempt does not exist. GetJob(context.Context, *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) // ListAnnotations lists the annotations of a run attempt, optionally of one // job, ordered by job (as in GetRun), step number, then the order in which // the step produced them. For each job it gives the annotations of the // attempt in which that job executed (RunJob.attempt), which is lower than // the attempt of the run for a job kept by a re-run of failed jobs only. Needs the same access as GetRun. Returns at most // 1,000 annotations (truncated tells). A run without annotations gives an // empty list. Only servers with the feature "ci.annotations" implement it // (unimplemented otherwise). Fails with not_found if the run, the attempt or // the job does not exist, or if the job is not a job of the run. ListAnnotations(context.Context, *connect.Request[ermite.ListAnnotationsRequest]) (*connect.Response[ermite.ListAnnotationsResponse], error) // GetStepSummaries returns the job summaries (the Markdown written to // GITHUB_STEP_SUMMARY) of the steps of a job that have one, ordered by step // number. Like GitHub, it returns at most 20 summaries per job: the first 20 // steps that have one, in step order; truncated says there are more. Needs // the same access as GetJob. Only servers with the feature // "ci.summaries" implement it (unimplemented otherwise). A job without // summaries gives an empty list. Fails with not_found if the job or the // attempt does not exist. GetStepSummaries(context.Context, *connect.Request[ermite.GetStepSummariesRequest]) (*connect.Response[ermite.GetStepSummariesResponse], error) // GetJobLog streams the lines of the log of a job, from a line number. The // server sends them in order in messages of at most 1,000 lines and 64 KiB of // text each. // // Without follow, the stream ends after the last line stored when the call // was made. With follow, it goes on as lines arrive, with at most 1 second of // delay after the runner's AppendLog, and ends without error once the job has // completed and all its lines were sent; on a completed job follow changes // nothing. A client that loses the stream calls again with the offset after // the last line it received. The client may cancel at any time. // // Fails with not_found if the job, the attempt or its log does not exist (the // log is removed by the retention sweep, and a queued job has none: with // follow, the call waits for the first line instead), with out_of_range if // offset is beyond the end of the log of a job without follow, and with // resource_exhausted when there are too many concurrent log streams, in // total or from one client. Like Watch, a stream ends with unauthenticated // when the token was revoked or expired. GetJobLog(context.Context, *connect.Request[ermite.GetJobLogRequest], *connect.ServerStream[ermite.GetJobLogResponse]) error // CancelRun asks to cancel the latest attempt of a run. Needs the ci:write // scope. Jobs that have not started are cancelled at once; jobs in progress // get a CANCEL_REASON_USER request through WatchJob, and the run completes // when they have ended, so the returned run may still be IN_PROGRESS. // Cancelling a run that already has a cancellation requested succeeds and // changes nothing. Fails with failed_precondition if the run has completed. CancelRun(context.Context, *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) // RerunRun starts a new attempt of a completed run: same run id and number, // attempt + 1, same commit and same workflow file as at the original run (the // file of the repository is not read again). Needs the ci:write scope. Fails // with failed_precondition if the latest attempt has not completed, or if // failed_only is set and no job failed. The new attempt is returned QUEUED. RerunRun(context.Context, *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) // DispatchWorkflow starts a run of a workflow file by hand, like `gh // workflow run` and GitHub's "workflow_dispatch" event. Needs the ci:write // scope on the repository. The workflow is read at ref and must have // "workflow_dispatch" among its events. The run has event // "workflow_dispatch", ref and the commit ref points to, and the caller as // actor; it is trusted when the caller is the owner and not trusted when the // caller is a token limited to branches. The run is returned QUEUED, before // any job has been given to a runner. Only servers with the feature // "ci.dispatch" implement it (unimplemented otherwise). Fails with // not_found if the repository, the workflow file or ref does not exist, // with failed_precondition if the workflow does not declare // "workflow_dispatch", and with invalid_argument if an input is unknown, is // missing while required without default, or has a value of the wrong type // or outside its choices, or if the workflow file is not valid. DispatchWorkflow(context.Context, *connect.Request[ermite.DispatchWorkflowRequest]) (*connect.Response[ermite.DispatchWorkflowResponse], error) // ListChecks lists the checks of a commit: for each job of each run on that // sha, the one of the latest attempt, ordered by creation time then name. // A commit without a run has no check: the list is empty, which is not an // error, and the server does not verify that the commit exists. Returns at // most 1,000 checks (truncated tells). ListChecks(context.Context, *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) // ListRunners lists the registered runners, ordered by name. Needs the // runner:register scope. ListRunners(context.Context, *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) // RemoveRunner removes a runner: its runner token stops working at once (a // FetchJob in progress ends with unauthenticated) and it no longer gets // jobs. A job it is running is not affected: it ends normally, or fails as // a lost runner without heartbeats. Needs the runner:register scope. Fails // with not_found if the id is unknown. RemoveRunner(context.Context, *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) } // NewRunServiceHandler builds an HTTP handler from the service implementation. It returns the path // on which to mount the handler and the handler itself. // // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewRunServiceHandler(svc RunServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { runServiceMethods := ermite.File_ermite_run_proto.Services().ByName("RunService").Methods() runServiceListRunsHandler := connect.NewUnaryHandler( RunServiceListRunsProcedure, svc.ListRuns, connect.WithSchema(runServiceMethods.ByName("ListRuns")), connect.WithHandlerOptions(opts...), ) runServiceGetRunHandler := connect.NewUnaryHandler( RunServiceGetRunProcedure, svc.GetRun, connect.WithSchema(runServiceMethods.ByName("GetRun")), connect.WithHandlerOptions(opts...), ) runServiceGetJobHandler := connect.NewUnaryHandler( RunServiceGetJobProcedure, svc.GetJob, connect.WithSchema(runServiceMethods.ByName("GetJob")), connect.WithHandlerOptions(opts...), ) runServiceListAnnotationsHandler := connect.NewUnaryHandler( RunServiceListAnnotationsProcedure, svc.ListAnnotations, connect.WithSchema(runServiceMethods.ByName("ListAnnotations")), connect.WithHandlerOptions(opts...), ) runServiceGetStepSummariesHandler := connect.NewUnaryHandler( RunServiceGetStepSummariesProcedure, svc.GetStepSummaries, connect.WithSchema(runServiceMethods.ByName("GetStepSummaries")), connect.WithHandlerOptions(opts...), ) runServiceGetJobLogHandler := connect.NewServerStreamHandler( RunServiceGetJobLogProcedure, svc.GetJobLog, connect.WithSchema(runServiceMethods.ByName("GetJobLog")), connect.WithHandlerOptions(opts...), ) runServiceCancelRunHandler := connect.NewUnaryHandler( RunServiceCancelRunProcedure, svc.CancelRun, connect.WithSchema(runServiceMethods.ByName("CancelRun")), connect.WithHandlerOptions(opts...), ) runServiceRerunRunHandler := connect.NewUnaryHandler( RunServiceRerunRunProcedure, svc.RerunRun, connect.WithSchema(runServiceMethods.ByName("RerunRun")), connect.WithHandlerOptions(opts...), ) runServiceDispatchWorkflowHandler := connect.NewUnaryHandler( RunServiceDispatchWorkflowProcedure, svc.DispatchWorkflow, connect.WithSchema(runServiceMethods.ByName("DispatchWorkflow")), connect.WithHandlerOptions(opts...), ) runServiceListChecksHandler := connect.NewUnaryHandler( RunServiceListChecksProcedure, svc.ListChecks, connect.WithSchema(runServiceMethods.ByName("ListChecks")), connect.WithHandlerOptions(opts...), ) runServiceListRunnersHandler := connect.NewUnaryHandler( RunServiceListRunnersProcedure, svc.ListRunners, connect.WithSchema(runServiceMethods.ByName("ListRunners")), connect.WithHandlerOptions(opts...), ) runServiceRemoveRunnerHandler := connect.NewUnaryHandler( RunServiceRemoveRunnerProcedure, svc.RemoveRunner, connect.WithSchema(runServiceMethods.ByName("RemoveRunner")), connect.WithHandlerOptions(opts...), ) return "/ermite.RunService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case RunServiceListRunsProcedure: runServiceListRunsHandler.ServeHTTP(w, r) case RunServiceGetRunProcedure: runServiceGetRunHandler.ServeHTTP(w, r) case RunServiceGetJobProcedure: runServiceGetJobHandler.ServeHTTP(w, r) case RunServiceListAnnotationsProcedure: runServiceListAnnotationsHandler.ServeHTTP(w, r) case RunServiceGetStepSummariesProcedure: runServiceGetStepSummariesHandler.ServeHTTP(w, r) case RunServiceGetJobLogProcedure: runServiceGetJobLogHandler.ServeHTTP(w, r) case RunServiceCancelRunProcedure: runServiceCancelRunHandler.ServeHTTP(w, r) case RunServiceRerunRunProcedure: runServiceRerunRunHandler.ServeHTTP(w, r) case RunServiceDispatchWorkflowProcedure: runServiceDispatchWorkflowHandler.ServeHTTP(w, r) case RunServiceListChecksProcedure: runServiceListChecksHandler.ServeHTTP(w, r) case RunServiceListRunnersProcedure: runServiceListRunnersHandler.ServeHTTP(w, r) case RunServiceRemoveRunnerProcedure: runServiceRemoveRunnerHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } }) } // UnimplementedRunServiceHandler returns CodeUnimplemented from all methods. type UnimplementedRunServiceHandler struct{} func (UnimplementedRunServiceHandler) ListRuns(context.Context, *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListRuns is not implemented")) } func (UnimplementedRunServiceHandler) GetRun(context.Context, *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetRun is not implemented")) } func (UnimplementedRunServiceHandler) GetJob(context.Context, *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetJob is not implemented")) } func (UnimplementedRunServiceHandler) ListAnnotations(context.Context, *connect.Request[ermite.ListAnnotationsRequest]) (*connect.Response[ermite.ListAnnotationsResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListAnnotations is not implemented")) } func (UnimplementedRunServiceHandler) GetStepSummaries(context.Context, *connect.Request[ermite.GetStepSummariesRequest]) (*connect.Response[ermite.GetStepSummariesResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetStepSummaries is not implemented")) } func (UnimplementedRunServiceHandler) GetJobLog(context.Context, *connect.Request[ermite.GetJobLogRequest], *connect.ServerStream[ermite.GetJobLogResponse]) error { return connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetJobLog is not implemented")) } func (UnimplementedRunServiceHandler) CancelRun(context.Context, *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.CancelRun is not implemented")) } func (UnimplementedRunServiceHandler) RerunRun(context.Context, *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.RerunRun is not implemented")) } func (UnimplementedRunServiceHandler) DispatchWorkflow(context.Context, *connect.Request[ermite.DispatchWorkflowRequest]) (*connect.Response[ermite.DispatchWorkflowResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.DispatchWorkflow is not implemented")) } func (UnimplementedRunServiceHandler) ListChecks(context.Context, *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListChecks is not implemented")) } func (UnimplementedRunServiceHandler) ListRunners(context.Context, *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListRunners is not implemented")) } func (UnimplementedRunServiceHandler) RemoveRunner(context.Context, *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.RemoveRunner is not implemented")) }