Documentation ¶
Overview ¶
Package jobber time strings parser from jobber
Example (Simple) ¶
package main import ( "fmt" "time" "github.com/Akagi201/utilgo/jobber" ) func main() { timeStr := "*/2 * * * * *" res, err := jobber.ParseFullTimeSpec(timeStr) if err != nil { fmt.Errorf("Parse time string failed, err: %v\n", err) return } fmt.Printf("Time string: %v\n", res.String()) now := time.Now() fmt.Printf("now: %v, next: %v\n", now, res.Next(now)) }
Output:
Index ¶
Examples ¶
Constants ¶
View Source
const (
TimeWildcard = "*"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FullTimeSpec ¶
type FullTimeSpec struct { Sec TimeSpec Min TimeSpec Hour TimeSpec Mday TimeSpec Mon TimeSpec Wday TimeSpec }
func ParseFullTimeSpec ¶
func ParseFullTimeSpec(s string) (*FullTimeSpec, error)
func (FullTimeSpec) String ¶
func (self FullTimeSpec) String() string
type OneValTimeSpec ¶
type OneValTimeSpec struct {
Val int
}
func (OneValTimeSpec) Satisfied ¶
func (s OneValTimeSpec) Satisfied(v int) bool
func (OneValTimeSpec) String ¶
func (s OneValTimeSpec) String() string
type SetTimeSpec ¶
func (SetTimeSpec) Satisfied ¶
func (s SetTimeSpec) Satisfied(v int) bool
func (SetTimeSpec) String ¶
func (s SetTimeSpec) String() string
type WildcardTimeSpec ¶
type WildcardTimeSpec struct { }
func (WildcardTimeSpec) Satisfied ¶
func (s WildcardTimeSpec) Satisfied(v int) bool
func (WildcardTimeSpec) String ¶
func (s WildcardTimeSpec) String() string
Click to show internal directories.
Click to hide internal directories.