WithScheduleTimeZone sets the time zone for cron schedule expressions. The zone must be a valid IANA time zone name (e.g., "America/New_York"). Only valid with cron schedule expressions; the server will reject this header if used with @at or @every schedules. Requires [StreamConfig.AllowMsgSchedules
(zone string)
| 811 | // header if used with @at or @every schedules. |
| 812 | // Requires [StreamConfig.AllowMsgSchedules] to be enabled. |
| 813 | func WithScheduleTimeZone(zone string) PublishOpt { |
| 814 | return func(opts *pubOpts) error { |
| 815 | if zone == "" { |
| 816 | return fmt.Errorf("%w: schedule time zone cannot be empty", ErrInvalidOption) |
| 817 | } |
| 818 | opts.scheduleTZ = zone |
| 819 | return nil |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | type nextOptFunc func(*nextOpts) |
| 824 |