Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 3.5% dependent repos on proxy.golang.org

proxy.golang.org : github.com/clintjedwards/avail

Package avail allows the representation of a time frame using common cron syntax and then efficiently check whether a given golang time object exists within that time frame. The package uses a subset of the extended cron standard: https://en.wikipedia.org/wiki/Cron#CRON_expression It is sometimes useful to represent certain timeframes using cron expressions. A great example is an application that may want to schedule employees for work. Representing the case where an employee cannot work every year on their birthday, would be difficult without representing it as some type of customized format (due to the nature that representing infinite time would fill your database needlessly). Using cron to achieve this allows the representation of situations like above to be compact and easy to parse. Other advantages include that the cron format is well documented and can potentially be represented in a user-friendly frontend component. Avail implements/uses a stripped down version of the cron expression syntax as defined below. Avail accepts a cron expression in the format above, splits it into separate fields, parses it, and generates map backed sets for each field in order to allow speedy checking of value existence. This data structure allows avail to take a supplied time and check that each of the time's elements exist in the representation of the cron expression. Initiate a new avail instance with cron expression. This will parse the cron expression given and return a new `Avail` object containing your given expression and its parsed terms(each section of the cron expression is called a term). Then call `able` with a specified go time object.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/clintjedwards/avail
Keywords: cron, cron-expression, golang, scheduling
License: MIT
Latest release: over 3 years ago
First release: over 3 years ago
Namespace: github.com/clintjedwards
Dependent repositories: 2
Stars: 2 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 21 days ago

    Loading...
    Readme
    Loading...