@@ -938,8 +938,8 @@ type StepFunc func(ctx context.Context) (any, error)
938938// Step represents a type-safe step function with a specific output type R.
939939type Step [R any ] func (ctx context.Context ) (R , error )
940940
941- // StepOptions holds the configuration for step execution using functional options pattern.
942- type StepOptions struct {
941+ // stepOptions holds the configuration for step execution using functional options pattern.
942+ type stepOptions struct {
943943 maxRetries int // Maximum number of retry attempts (0 = no retries)
944944 backoffFactor float64 // Exponential backoff multiplier between retries (default: 2.0)
945945 baseInterval time.Duration // Initial delay between retries (default: 100ms)
@@ -949,7 +949,7 @@ type StepOptions struct {
949949}
950950
951951// setDefaults applies default values to stepOptions
952- func (opts * StepOptions ) setDefaults () {
952+ func (opts * stepOptions ) setDefaults () {
953953 if opts .backoffFactor == 0 {
954954 opts .backoffFactor = _DEFAULT_STEP_BACKOFF_FACTOR
955955 }
@@ -962,12 +962,12 @@ func (opts *StepOptions) setDefaults() {
962962}
963963
964964// StepOption is a functional option for configuring step execution parameters.
965- type StepOption func (* StepOptions )
965+ type StepOption func (* stepOptions )
966966
967967// WithStepName sets a custom name for the step. If the step name has already been set
968968// by a previous call to WithStepName, this option will be ignored
969969func WithStepName (name string ) StepOption {
970- return func (opts * StepOptions ) {
970+ return func (opts * stepOptions ) {
971971 if opts .stepName == "" {
972972 opts .stepName = name
973973 }
@@ -977,7 +977,7 @@ func WithStepName(name string) StepOption {
977977// WithStepMaxRetries sets the maximum number of retry attempts for the step.
978978// A value of 0 means no retries (default behavior).
979979func WithStepMaxRetries (maxRetries int ) StepOption {
980- return func (opts * StepOptions ) {
980+ return func (opts * stepOptions ) {
981981 opts .maxRetries = maxRetries
982982 }
983983}
@@ -986,30 +986,30 @@ func WithStepMaxRetries(maxRetries int) StepOption {
986986// The delay between retries is calculated as: BaseInterval * (BackoffFactor^(retry-1))
987987// Default value is 2.0.
988988func WithBackoffFactor (factor float64 ) StepOption {
989- return func (opts * StepOptions ) {
989+ return func (opts * stepOptions ) {
990990 opts .backoffFactor = factor
991991 }
992992}
993993
994994// WithBaseInterval sets the initial delay between retries.
995995// Default value is 100ms.
996996func WithBaseInterval (interval time.Duration ) StepOption {
997- return func (opts * StepOptions ) {
997+ return func (opts * stepOptions ) {
998998 opts .baseInterval = interval
999999 }
10001000}
10011001
10021002// WithMaxInterval sets the maximum delay between retries.
10031003// Default value is 5s.
10041004func WithMaxInterval (interval time.Duration ) StepOption {
1005- return func (opts * StepOptions ) {
1005+ return func (opts * stepOptions ) {
10061006 opts .maxInterval = interval
10071007 }
10081008}
10091009
10101010
10111011func WithNextStepID (stepID int ) StepOption {
1012- return func (opts * StepOptions ) {
1012+ return func (opts * stepOptions ) {
10131013 opts .preGeneratedStepID = & stepID
10141014 }
10151015}
@@ -1100,7 +1100,7 @@ func RunAsStep[R any](ctx DBOSContext, fn Step[R], opts ...StepOption) (R, error
11001100
11011101func (c * dbosContext ) RunAsStep (_ DBOSContext , fn StepFunc , opts ... StepOption ) (any , error ) {
11021102 // Process functional options
1103- stepOpts := & StepOptions {}
1103+ stepOpts := & stepOptions {}
11041104 for _ , opt := range opts {
11051105 opt (stepOpts )
11061106 }
0 commit comments