Golang ticker that works with Cron scheduling.

Overview

cronticker

Golang ticker that works with Cron scheduling.

CircleCI Codecov Go Report Card

Import it

go get github.com/krayzpipes/cronticker/cronticker
import "github.com/krayzpipes/cronticker/cronticker"

Usage

Create a new ticker:

ticker, err := NewTicker("TZ=America/New_York 0 0 0 ? * SUN")

Check the ticker's channel for the next tick:

tickerTime := <-ticker.C

Reset the ticker to a new cron schedule

err := ticker.Reset("0 0 0 ? * MON,TUE,WED")

Stop the ticker

ticker.Stop()

Use defer ticker.Stop() whenever you can to ensure the cleanup of goroutines.

ticker, _ := NewTicker("@daily")
defer ticker.Stop()

Cron Schedule Format

The Cron schedule can be in Unix or Quartz format. Directives like '@weekly' or '@daily' can also be parsed as defined in the package github.com/robfig/cron/v3.

You may add the TimeZone/location to the beginning of the cron schedule to change the time zone. Default is UTC if TZ=Whatever is not prepended to the cron schedule.

Examples

Cron Schedule Type/Format Description
"TZ=America/Los_Angeles 0 0 * * *" Unix Daily at 12 AM in Los Angeles
"TZ=America/Los_Angeles 0 0 0 ? * MON" Quartz Mondays at 12 AM in Los Angeles
"TZ=America/Los_Angeles @daily" Directive Daily at 12 AM in Los Angeles
"@daily" Directive Daily at 12 AM UTC

You may also use the following characters:

Character Description Example
- Range 4-5
/ Step 0/5
* Any */5
, List 1,4,5
Issues
Releases(v0.0.1)
Owner
Kyle Piper
Pretty boring guy.
Kyle Piper
Logging library for Golang

GLO Logging library for Golang Inspired by Monolog for PHP, severity levels are identical Install go get github.com/lajosbencz/glo Severity levels Deb

Lajos Bencz 14 Aug 26, 2021
a golang log lib supports level and multi handlers

go-log a golang log lib supports level and multi handlers Use import "github.com/siddontang/go-log/log" //log with different level log.Info("hello wo

siddontang 29 Dec 28, 2021
LogVoyage - logging SaaS written in GoLang

No longer maintained, sorry. Completely rewritten v2 is going to be released soon. Please follow http://github.com/logvoyage LogVoyage - fast and simp

null 89 Aug 31, 2021
An golang log lib, supports tracking and level, wrap by standard log lib

Logex An golang log lib, supports tracing and level, wrap by standard log lib How To Get shell go get gopkg.in/logex.v1 source code import "gopkg.in/

chzyer 38 Jan 9, 2022
Utilities for slightly better logging in Go (Golang).

logutils logutils is a Go package that augments the standard library "log" package to make logging a bit more modern, without fragmenting the Go ecosy

HashiCorp 305 Jan 16, 2022
Dead simple, super fast, zero allocation and modular logger for Golang

Onelog Onelog is a dead simple but very efficient JSON logger. It is one of the fastest JSON logger out there. Also, it is one of the logger with the

Francois Parquet 401 Jan 4, 2022
A Go (golang) package providing high-performance asynchronous logging, message filtering by severity and category, and multiple message targets.

ozzo-log Other languages 简体中文 Русский Description ozzo-log is a Go package providing enhanced logging support for Go programs. It has the following fe

Ozzo Framework 118 Jan 11, 2022
Golang logging library

Golang logging library Package logging implements a logging infrastructure for Go. Its output format is customizable and supports different logging ba

Örjan Fors 1.7k Jan 5, 2022
A feature-rich and easy to use logger for golang

A feature-rich and easy to use logger for golang ?? Install ?? Common Logs lumber.Success() lumber.Info() lumber.Debug() lumber.Warning()

Matthew Gleich 47 Jan 3, 2022
A system and resource monitoring tool written in Golang!

Grofer A clean and modern system and resource monitor written purely in golang using termui and gopsutil! Currently compatible with Linux only. Curren

PES Open Source Community 190 Jan 12, 2022
Golang beautify data display for Humans

Golang beautify data display for Humans English 简体中文 Usage Examples package main import ( ffmt "gopkg.in/ffmt.v1" ) func main() { example() } typ

ffmt 248 Jan 12, 2022
Logstash like, written in golang

gogstash Logstash like, written in golang Download gogstash from github check latest version Use docker image tsaikd/gogstash curl 'https://github.com

Tsai KD 570 Jan 19, 2022
Open Source Supreme Monitor Based on GoLang

Open Source Supreme Monitor Based on GoLang A module built for personal use but ended up being worthy to have it open sourced.

SneakyKiwi 16 Dec 15, 2021
Parametrized JSON logging library in Golang which lets you obfuscate sensitive data and marshal any kind of content.

Noodlog Summary Noodlog is a Golang JSON parametrized and highly configurable logging library. It allows you to: print go structs as JSON messages; pr

Gyoza Tech 35 Dec 29, 2021
HTTP request logger for Golang

Horus ?? Introduction Horus is a request logger and viewer for Go. It allows developers log and view http requests made to their web application. Inst

Michael Okoh 72 Dec 28, 2021
Example instrumentation of Golang Application with OpenTelemetry with supported configurations to export to Sentry.

Sentry + Opentelemetry Go Example Requirements To run this example, you will need a kubernetes cluster. This example has been tried and tested on Mini

Uddeshya Singh 9 Dec 17, 2021
🪵 A dead simple, pretty, and feature-rich logger for golang

?? lumber ?? A dead simple, pretty, and feature-rich logger for golang ?? Install ?? Logging Functions lumber.Success() lumber.Info() lumber.Debug() l

Matt Gleich 47 Jan 3, 2022
Cloud logging library in golang

?? logg Open Source Cloud logging library in Go. About the project Connect your golang microservices logs with this engine! Send your logs to kafka, r

yuri 3 Nov 8, 2021
Next Generation Monitoring Server With Golang

Next Generation Monitoring Server Build make Arguments $ bin/ng-monitoring-server --help Usage of bin/ng-monitoring-server: --address string

PingCAP 15 Jan 19, 2022