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
Philipp Heckel
committed
Dec 18, 2021
1 parent
5639cf7
commit f266afa
Showing
12 changed files
with
209 additions
and
74 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
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,18 @@ | ||
# ntfy client config file | ||
|
||
# Base URL used to expand short topic names in the "ntfy publish" and "ntfy subscribe" commands. | ||
# If you self-host a ntfy server, you'll likely want to change this. | ||
# | ||
# default-host: https://ntfy.sh | ||
|
||
# Subscriptions to topics and their actions. This option is only used by the "ntfy subscribe --from-config" | ||
# command. | ||
# | ||
# Here's a (hopefully self-explanatory) example: | ||
# subscribe: | ||
# - topic: mytopic | ||
# exec: /usr/local/bin/mytopic-triggered.sh | ||
# - topic: myserver.com/anothertopic | ||
# exec: 'echo "$message"' | ||
# | ||
# subscribe: |
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,20 @@ | ||
package client | ||
|
||
const ( | ||
DefaultBaseURL = "https://ntfy.sh" | ||
) | ||
|
||
type Config struct { | ||
DefaultHost string | ||
Subscribe []struct { | ||
Topic string | ||
Exec string | ||
} | ||
} | ||
|
||
func NewConfig() *Config { | ||
return &Config{ | ||
DefaultHost: DefaultBaseURL, | ||
Subscribe: nil, | ||
} | ||
} |
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
Oops, something went wrong.