github.com/blend/go-sdk@v1.20220411.3/cron/never_schedule.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package cron 9 10 import ( 11 "fmt" 12 "time" 13 ) 14 15 var ( 16 _ Schedule = (*NeverSchedule)(nil) 17 _ fmt.Stringer = (*NeverSchedule)(nil) 18 ) 19 20 // Never returns a never schedule. 21 func Never() NeverSchedule { return NeverSchedule{} } 22 23 // NeverSchedule is a schedule that never runs. 24 type NeverSchedule struct{} 25 26 // Next implements Schedule 27 func (ns NeverSchedule) Next(_ time.Time) time.Time { return time.Time{} } 28 29 // String implements fmt.Stringer. 30 func (ns NeverSchedule) String() string { return StringScheduleNever }