pax_global_header 0000666 0000000 0000000 00000000064 14650125332 0014513 g ustar 00root root 0000000 0000000 52 comment=ae3ed48951563f370fb02d881cf30dc5219b04cf golang-github-atomicgo-schedule-0.1.0/ 0000775 0000000 0000000 00000000000 14650125332 0017632 5 ustar 00root root 0000000 0000000 golang-github-atomicgo-schedule-0.1.0/.github/ 0000775 0000000 0000000 00000000000 14650125332 0021172 5 ustar 00root root 0000000 0000000 golang-github-atomicgo-schedule-0.1.0/.github/release.yml 0000664 0000000 0000000 00000000536 14650125332 0023341 0 ustar 00root root 0000000 0000000 changelog: exclude: labels: - ignore-for-release authors: - octocat categories: - title: Breaking Changes 🛠 labels: - breaking - title: Exciting New Features 🎉 labels: - feature - title: Fixes 🔧 labels: - fix - title: Other Changes labels: - "*" golang-github-atomicgo-schedule-0.1.0/.github/settings.yml 0000664 0000000 0000000 00000001677 14650125332 0023570 0 ustar 00root root 0000000 0000000 _extends: .github repository: # See https://developer.github.com/v3/repos/#edit for all available settings. # A short description of the repository that will show up on GitHub description: ⏰ Easily schedule non-blocking tasks in Go. Supports durations, specific times and intervals. # A comma-separated list of topics to set on the repository topics: atomicgo, go, golang, golang-library, scheduler, time, ticker, schedule, timer, hacktoberfest # Either `true` to make the repository private, or `false` to make it public. private: false # Either `true` to enable issues for this repository, `false` to disable them. has_issues: true # Either `true` to enable projects for this repository, or `false` to disable them. # If projects are disabled for the organization, passing `true` will cause an API error. has_projects: false # Either `true` to enable the wiki for this repository, `false` to disable it. has_wiki: false golang-github-atomicgo-schedule-0.1.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14650125332 0023227 5 ustar 00root root 0000000 0000000 golang-github-atomicgo-schedule-0.1.0/.github/workflows/atomicgo.yml 0000664 0000000 0000000 00000000505 14650125332 0025554 0 ustar 00root root 0000000 0000000 name: AtomicGo on: push: branches: [ main ] jobs: docs: if: "!contains(github.event.head_commit.message, 'autoupdate')" runs-on: ubuntu-latest steps: - name: Update Docs uses: atomicgo/ci@main env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} TERM: xterm-256color golang-github-atomicgo-schedule-0.1.0/.github/workflows/go.yml 0000664 0000000 0000000 00000001326 14650125332 0024361 0 ustar 00root root 0000000 0000000 name: Go on: push: branches: [ main ] pull_request: jobs: build: name: Build runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - name: Set up Go 1.x uses: actions/setup-go@v2 with: go-version: ^1 id: go - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Get dependencies run: go get -v -t -d ./... - name: Build run: go build -v . - name: Test run: go test -coverprofile="coverage.txt" -covermode=atomic -v -p 1 . - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 golang-github-atomicgo-schedule-0.1.0/.github/workflows/lint.yml 0000664 0000000 0000000 00000000651 14650125332 0024722 0 ustar 00root root 0000000 0000000 name: Code analysis on: [pull_request] jobs: golangci-lint: runs-on: ubuntu-latest steps: - name: Check out code into the Go module directory uses: actions/checkout@v3 with: fetch-depth: 0 - name: Linting with golangci-lint uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.ACCESS_TOKEN }} reporter: github-pr-review golang-github-atomicgo-schedule-0.1.0/.github/workflows/tweet-release.yml 0000664 0000000 0000000 00000001616 14650125332 0026524 0 ustar 00root root 0000000 0000000 name: Tweet release # Listen to the `release` event on: release: types: [published] jobs: tweet: runs-on: ubuntu-latest steps: - uses: Eomm/why-don-t-you-tweet@v1 # We don't want to tweet if the repository is not a public one if: ${{ !github.event.repository.private }} with: tweet-message: "New ${{ github.event.repository.name }} release: ${{ github.event.release.tag_name }}! 🎉 Try it out: ${{ github.event.release.html_url }} #go #golang #opensource #library #release #atomicgo" env: TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} golang-github-atomicgo-schedule-0.1.0/.gitignore 0000664 0000000 0000000 00000000742 14650125332 0021625 0 ustar 00root root 0000000 0000000 # Go template ## Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib ## Test binary, built with `go test -c` *.test ## Output of the go coverage tool, specifically when used with LiteIDE *.out ## Dependency directories (remove the comment below to include it) vendor/ # IDEs ## IntelliJ .idea *.iml out gen ## Visual Studio Code .vscode *.code-workspace # Operating System Files ## macOS ### General .DS_Store # Other ## Experimenting folder experimenting golang-github-atomicgo-schedule-0.1.0/.golangci.yml 0000664 0000000 0000000 00000003234 14650125332 0022220 0 ustar 00root root 0000000 0000000 linters-settings: gocritic: enabled-tags: - diagnostic - experimental - opinionated - performance - style disabled-checks: - dupImport - ifElseChain - octalLiteral - whyNoLint - wrapperFunc - exitAfterDefer - hugeParam - ptrToRefParam - paramTypeCombine - unnamedResult linters: disable-all: true enable: # default linters - errcheck - gosimple - govet - ineffassign - staticcheck - typecheck - unused # additional linters - asasalint - asciicheck - bidichk - bodyclose - containedctx - contextcheck - decorder - dupl - durationcheck - errchkjson - errname - errorlint - exhaustive - exhaustruct - exportloopref - forcetypeassert - gocheckcompilerdirectives - gocritic - godot - godox - goerr113 - gofmt - goprintffuncname - gosec - gosmopolitan - importas - ireturn - nakedret - nestif - nilerr - nilnil - prealloc - predeclared - revive - rowserrcheck - tagalign - tenv - thelper - tparallel - unconvert - unparam - usestdlibvars - wastedassign - whitespace - wrapcheck - wsl - gocyclo - misspell issues: include: - EXC0012 - EXC0014 exclude-rules: - path: _test\.go linters: - gocyclo - errcheck - dupl - gosec - gocritic - linters: - gocritic text: "unnecessaryDefer:" - linters: - gocritic text: "preferDecodeRune:" service: golangci-lint-version: 1.53.x golang-github-atomicgo-schedule-0.1.0/LICENSE 0000664 0000000 0000000 00000002074 14650125332 0020642 0 ustar 00root root 0000000 0000000 MIT License Copyright (c) 2022 Marvin Wendt (MarvinJWendt) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. golang-github-atomicgo-schedule-0.1.0/README.md 0000664 0000000 0000000 00000015420 14650125332 0021113 0 ustar 00root root 0000000 0000000
Documentation | Contributing | Code of Conduct
---
go get atomicgo.dev/schedule
```go package main import ( "fmt" "time" "atomicgo.dev/schedule" ) func main() { task := schedule.After(5*time.Second, func() { fmt.Println("5 seconds are over!") }) fmt.Println("Some stuff happening...") task.Wait() } ```
```go package main import ( "fmt" "time" "atomicgo.dev/schedule" ) func main() { task := schedule.At(time.Now().Add(5*time.Second), func() { fmt.Println("5 seconds are over!") }) fmt.Println("Some stuff happening...") task.Wait() } ```
```go package main import ( "fmt" "time" "atomicgo.dev/schedule" ) func main() { task := schedule.Every(time.Second, func() bool { fmt.Println("1 second is over!") return true // return false to stop the task }) fmt.Println("Some stuff happening...") time.Sleep(10 * time.Second) task.Stop() } ```