Move docs to docs folder, rename files

This commit is contained in:
askiiart 2024-01-29 17:26:50 -06:00
parent 082ffbe79a
commit c933b5a8a1
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
5 changed files with 152 additions and 106 deletions

35
docs/extensions/README.md Normal file
View file

@ -0,0 +1,35 @@
# Extensions
Extensions go in the `./extensions/` folder, where exactly depends on which type of extension.
- Extensions for checking status ("checkers") go in `./extensions/checkers/`
- Extensions for alerting go in `./extensions/alerts/`
- Extensions for logging go in `./extensions/logging/`
Note that the folder name *must* be the same as the file name for the extension (excluding .py)!
## Example
```txt
.
├── extensions
│ ├── alerts
│ │ └── alerts_template
│ │ └── alerts_template.py
│ ├── checkers
│ │ └── checker_template
│ │ └── checker_template.py
│ └── logging
│ └── logging_template
│ └── logging_template.py
```
## List of extensions
There are none yet, so consider this secret a placeholder
### Checkers
### Alerts
## Logging

View file

@ -0,0 +1,62 @@
# Uptime Checker Extensions
Updog doesn't do any monitoring by itself. Instead, extensions are used to check the status of whatever thing, send alerts, and log stuff. Updog just chains them together.
Example extension: [askiiart/updog-checker_template](https://git.askiiart.net/askiiart/updog-checker_template)
## Folder layout
Extensions need to be put in the `./extensions/checkers` folder, and the name of the file must match the name of the folder.
```txt
.
├── extensions
│ ├── alerts
│ └── alerts_template
│ └── alerts_template.py
```
## Methods
`*`: indicates a method is required
### `__init__()`*
**Arguments**:
- A dict of arguments from `checker-args` in `services.json` - For no arguments, an empty dict will be used
Example:
```py
{
"url": "https://example.net",
"port": 443
}
```
**Return**: None
### `get_status()`*
**Arguments**: None
**Return**: An integer indicating status; the codes; what the code means is provided by [`get_return_codes()`](#get_return_codes)
These values can be overriden by providing [`get_return_codes()`](#get_return_codes)
### `get_return_codes()`*
**Arguments**: None
**Return**: A `dict` containing integers and their associated statuses.
Example:
```py
{
0: "Down",
50: "Partial outage",
100: "Up"
}
```