generated from golang-templates/seed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
113 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"env": {}, | ||
"args": [ | ||
"-c", | ||
"config.example.yaml" | ||
"config.local.yaml" | ||
] | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/FMotalleb/crontab-go/main/schema.json | ||
#TODO: unix/tcp socket controller | ||
#TODO: prometheus exporter | ||
|
||
jobs: | ||
# Jobs can be assigned a unique name, which will be included in log messages for easier debugging. | ||
- name: Test Job | ||
# Description is reserved for the future | ||
description: Sample of a single job | ||
# Jobs can be disabled explicitly instead of commenting/removing the job | ||
# disabled: true | ||
tasks: | ||
# This line specifies the actual command to be executed. | ||
- command: echo $(whoami) | ||
# This setting determines the number of times the task will be retried if it fails | ||
# A failure is defined by either a non-zero exit code for commands or a status code of 400 or higher for HTTP requests. | ||
retries: 3 | ||
# This specifies the delay between retries. | ||
retry-delay: 1s | ||
# This sets a maximum time limit for the task to complete. | ||
# If the task exceeds 15 seconds, it will be considered failed and stopped (command) or canceled (http requests) | ||
timeout: 15s | ||
user: root | ||
# # This defines the working directory for the command. | ||
working-dir: /home/user | ||
# This section allows you to set environment variables that will be available to the command during execution. | ||
# `SHELL` and `SHELL_ARGS` can be used to change this commands shell environment | ||
env: | ||
SHELL: /usr/bin/bash | ||
SHELL_ARGS: -c | ||
# DB_HOST: 10.0.0.5 | ||
|
||
# # A simple get request | ||
# - get: https://example.com/get | ||
# # headers of request `map[string]string` | ||
# headers: | ||
# - "Accepts": "Application/Json" | ||
|
||
# # A simple post request example | ||
# - post: https://example.com/post | ||
# # headers of request `map[string]string` | ||
# headers: | ||
# - "Accepts": "Application/Json" | ||
# # Body of post request (can be a json object) | ||
# data: | ||
# key: value | ||
schedulers: | ||
- on-init: true | ||
# Schedulers can be defined using either a cron expression or an interval, but not both simultaneously. | ||
# However, you can combine multiple cron expressions and intervals within the same scheduler. | ||
|
||
# The cron scheduler allows you to specify schedules down to the second level of precision using cron expressions. | ||
- cron: "@yearly" | ||
# Intervals can be defined using human-readable formats. | ||
# For example, '10h' represents 10 hours, '10m' represents 10 minutes, and '10m15s' represents every 10 minutes and 15 seconds. | ||
# You can use units of hours (h), minutes (m), seconds (s), milliseconds (ms), and nanoseconds (ns) to define your intervals. | ||
- interval: 10m10s | ||
hooks: | ||
# Hooks are essentially tasks like those used in jobs, but they do not support nested hooks. | ||
# Additionally, errors or completion status of hooks are not directly managed by the system. | ||
# Instead, they are logged for informational purposes. | ||
|
||
# Every command within a job triggers its own set of hooks. | ||
# For instance, a job with two tasks and three 'done' hooks will execute a total of six hooks (if done) | ||
# during a single run: three for each task. | ||
|
||
# The 'done' hook will be triggered for HTTP requests with status codes below 400, | ||
# indicating successful completion. | ||
# For commands, the 'done' hook will be triggered if the exit code is 0, | ||
# signifying successful execution. | ||
# otherwise the `failed` hooks will be executed | ||
done: | ||
- command: echo Ok | ||
failed: | ||
- command: echo Failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# yaml-language-server: $schema=schema.json | ||
#TODO: unix/tcp socket controller | ||
#TODO: prometheus exporter | ||
|
||
jobs: | ||
- name: Test Job | ||
tasks: | ||
- command: ip a | ||
env: | ||
SHELL: C:\WINDOWS\System32\OpenSSH\ssh.exe | ||
SHELL_ARGS: "-i;C:/Users/Motalleb/.xpipe/storage/data/id_rsa_old;[email protected];-p;9011" | ||
schedulers: | ||
- on-init: true | ||
- interval: 10m10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
//go:build !windows | ||
// +build !windows | ||
//go:build unix | ||
|
||
package credential | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters