MCPcopy
hub / github.com/nats-io/nats.go / WithScheduleTimeZone

Function WithScheduleTimeZone

jetstream/jetstream_options.go:813–821  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

811// header if used with @at or @every schedules.
812// Requires [StreamConfig.AllowMsgSchedules] to be enabled.
813func 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
823type nextOptFunc func(*nextOpts)
824

Callers 1

Calls 1

ErrorfMethod · 0.80

Tested by 1