Skip to content

sqrt-7/go-cronexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRON Expression Parser

Description

This application takes a single cron expression string as a command-line argument and prints out the expanded view of the given schedule.

Requirements

  • go 1.14+
  • make

Setup

  1. Clone git repository to local machine
git clone https://github.com/sqrt-7/go-cronexp.git && cd go-cronexp
  1. Download dependencies
go mod download
  1. Compile application
make build
  1. Run with cron expression as the argument
./run_cronexp "*/15 0 1,15 * 1-5 /usr/bin/find"
  1. Expected output (example)
minute        0 15 30 45
hour          0
day of month  1 15
month         1 2 3 4 5 6 7 8 9 10 11 12
day of week   1 2 3 4 5
command       /usr/bin/find

Testing

  • Unit tests are located at pkg/cronexp/cronexp_test.go
  • Run unit tests:
make unit-test

Troubleshooting

  • If the application has to be compiled for a specific os/architecture:
# For valid GOOS/GOARCH combinations run 
go tool dist list

# Replace GOOS and GOARCH with the chosen values
GOOS=darwin GOARCH=amd64 go build -o ./run_cronexp ./cmd/cli/main.go

About

Cron Expression Parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published