Documentation
¶
Overview ¶
Package service implements the gRPC API declared in ../../../proto/step.proto
Index ¶
- func ErrorOnPanic() []grpc.ServerOption
- func WithExecutor(executor func(delegate func())) func(service *StepRunnerService)
- func WithOperatorLogger(l *slog.Logger) func(*StepRunnerService)
- type PanicError
- type StepRunnerService
- func (s *StepRunnerService) Cancel(_ context.Context, request *proto.CancelRequest) (*proto.CancelResponse, error)
- func (s *StepRunnerService) Close(_ context.Context, request *proto.CloseRequest) (*proto.CloseResponse, error)
- func (s *StepRunnerService) FollowLogs(request *proto.FollowLogsRequest, writer proto.StepRunner_FollowLogsServer) error
- func (s *StepRunnerService) Run(ctx context.Context, request *proto.RunRequest) (response *proto.RunResponse, err error)
- func (s *StepRunnerService) Shutdown(ctx context.Context, sig os.Signal)
- func (s *StepRunnerService) Status(ctx context.Context, request *proto.StatusRequest) (*proto.StatusResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorOnPanic ¶ added in v0.33.0
func ErrorOnPanic() []grpc.ServerOption
ErrorOnPanic returns grpc.ServerOption values that wire up panic recovery interceptors.
func WithExecutor ¶ added in v0.6.0
func WithExecutor(executor func(delegate func())) func(service *StepRunnerService)
func WithOperatorLogger ¶ added in v0.39.0
func WithOperatorLogger(l *slog.Logger) func(*StepRunnerService)
WithOperatorLogger sets the operator-facing logger, threaded down to each job. Defaults to slog.Default().
Types ¶
type PanicError ¶ added in v0.33.0
PanicError represents a recovered panic with its stack trace.
func (*PanicError) Error ¶ added in v0.33.0
func (e *PanicError) Error() string
func (*PanicError) GRPCStatus ¶ added in v0.33.0
func (e *PanicError) GRPCStatus() *status.Status
GRPCStatus returns a gRPC status so the error is transmitted as codes.Internal over the wire.
type StepRunnerService ¶
type StepRunnerService struct {
proto.StepRunnerServer
// contains filtered or unexported fields
}
StepRunnerService implements the gRPC StepRunner service.
func New ¶
func New(stepParser runner.StepParser, env *runner.Environment, options ...func(*StepRunnerService)) *StepRunnerService
func (*StepRunnerService) Cancel ¶ added in v0.35.0
func (s *StepRunnerService) Cancel(_ context.Context, request *proto.CancelRequest) (*proto.CancelResponse, error)
func (*StepRunnerService) Close ¶
func (s *StepRunnerService) Close(_ context.Context, request *proto.CloseRequest) (*proto.CloseResponse, error)
func (*StepRunnerService) FollowLogs ¶
func (s *StepRunnerService) FollowLogs(request *proto.FollowLogsRequest, writer proto.StepRunner_FollowLogsServer) error
func (*StepRunnerService) Run ¶
func (s *StepRunnerService) Run(ctx context.Context, request *proto.RunRequest) (response *proto.RunResponse, err error)
Run parses, prepares, and initiates execution of a RunRequest.
func (*StepRunnerService) Shutdown ¶ added in v0.45.0
func (s *StepRunnerService) Shutdown(ctx context.Context, sig os.Signal)
Shutdown refuses new jobs, fails every job that is still running because the process received sig and cancels it so its steps stop, then waits until every open job has finished and been closed by its client, or ctx is done. Call it before grpc.Server.GracefulStop: GracefulStop stops accepting the Status and Close calls a client makes once the log stream ends, so without this step the client sees only a transport error, no cause and no exit code.
func (*StepRunnerService) Status ¶
func (s *StepRunnerService) Status(ctx context.Context, request *proto.StatusRequest) (*proto.StatusResponse, error)