Documentation
¶
Index ¶
- Constants
- func GenericNotificationsEnabled() bool
- func ItsUsedTrustMeBro(...any)
- func LoadDotEnv(path string) error
- func LoadDotEnvIfExists(path string) error
- func Main() int
- func NotificationsEnabledForWidget(widgetType string) bool
- func SendAppriseNotification(settings notificationSettings, title string, body string, notifyType string) error
- func SendWidgetNotification(widgetType string, title string, body string, notifyType string)
- func ShouldUseGenericNotifications(widgetType string) bool
- func StringSetChanged(previous, current map[string]struct{}) bool
- type CustomAPIRequest
- type MarketProvider
- type RateLimitConfig
- type SearchBang
- type SiteStatusRequest
Constants ¶
View Source
const AUTH_RATE_LIMIT_MAX_ATTEMPTS = 5
View Source
const AUTH_RATE_LIMIT_WINDOW = 5 * time.Minute
View Source
const AUTH_SECRET_KEY_LENGTH = AUTH_TOKEN_SECRET_LENGTH + AUTH_USERNAME_HASH_LENGTH
View Source
const AUTH_SESSION_COOKIE_NAME = "session_token"
View Source
const AUTH_TIMESTAMP_LENGTH = 4 // uint32
View Source
const AUTH_TOKEN_DATA_LENGTH = AUTH_USERNAME_HASH_LENGTH + AUTH_TIMESTAMP_LENGTH
View Source
const AUTH_TOKEN_REGEN_BEFORE = 7 * 24 * time.Hour // 7 days
How long the token has left before it should be regenerated
View Source
const AUTH_TOKEN_SECRET_LENGTH = 32
View Source
const AUTH_TOKEN_VALID_PERIOD = 14 * 24 * time.Hour // 14 days
How long the token will be valid for
View Source
const AUTH_USERNAME_HASH_LENGTH = 32
View Source
const CONFIG_INCLUDE_RECURSION_DEPTH_LIMIT = 20
View Source
const STATIC_ASSETS_CACHE_DURATION = 24 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func GenericNotificationsEnabled ¶ added in v0.1.6
func GenericNotificationsEnabled() bool
func ItsUsedTrustMeBro ¶
func ItsUsedTrustMeBro(...any)
Having compile time errors about unused variables is cool and all, but I don't want to have to constantly comment out my code while I'm working on it and testing things out
func LoadDotEnv ¶ added in v0.1.5
LoadDotEnv loads environment variables from a .env file without overriding existing values. It is a minimal parser intended for simple KEY=VALUE lines.
func LoadDotEnvIfExists ¶ added in v0.1.5
func NotificationsEnabledForWidget ¶ added in v0.1.5
func SendAppriseNotification ¶ added in v0.1.5
func SendWidgetNotification ¶ added in v0.1.5
func ShouldUseGenericNotifications ¶ added in v0.1.5
func StringSetChanged ¶ added in v0.1.5
Types ¶
type CustomAPIRequest ¶
type CustomAPIRequest struct {
URL string `yaml:"url"`
AllowInsecure bool `yaml:"allow-insecure"`
Headers map[string]string `yaml:"headers"`
Parameters queryParametersField `yaml:"parameters"`
Method string `yaml:"method"`
BodyType string `yaml:"body-type"`
Body any `yaml:"body"`
SkipJSONValidation bool `yaml:"skip-json-validation"`
// contains filtered or unexported fields
}
Needs to be exported for the YAML unmarshaler to work
type MarketProvider ¶ added in v0.1.8
type MarketProvider interface {
// FetchMarkets retrieves market data for the given symbols.
// apiKey may be empty for providers that don't require one.
FetchMarkets(requests []marketRequest, apiKey string) (marketList, error)
}
MarketProvider is the interface all market data providers must implement. To add a new provider:
- Create a new file: market-provider-<name>.go
- Implement this interface
- Call registerMarketProvider("<name>", &yourProvider{}) in an init() func
type RateLimitConfig ¶ added in v0.1.8
type RateLimitConfig struct {
MaxCredits int // bucket size (burst capacity)
RefillRate int // credits added per refill period
RefillPeriod time.Duration // how often credits are refilled
}
RateLimitConfig defines rate limiting parameters for a provider.
type SearchBang ¶
type SiteStatusRequest ¶
Source Files
¶
- auth.go
- cli.go
- config-fields.go
- config.go
- diagnose.go
- embed.go
- env.go
- events.go
- luna.go
- main.go
- market-provider-finnhub.go
- market-provider-stooq.go
- market-provider-tmx.go
- market-provider-twelvedata.go
- market-provider-yahoo.go
- market-provider.go
- notifications.go
- templates.go
- theme.go
- utils.go
- widget-bookmarks.go
- widget-calendar.go
- widget-changedetection.go
- widget-clock.go
- widget-container.go
- widget-custom-api.go
- widget-dns-stats.go
- widget-docker-containers.go
- widget-extension.go
- widget-group.go
- widget-hacker-news.go
- widget-html.go
- widget-iframe.go
- widget-lobsters.go
- widget-markets.go
- widget-monitor.go
- widget-old-calendar.go
- widget-reddit.go
- widget-releases.go
- widget-repository.go
- widget-rss.go
- widget-search.go
- widget-server-stats.go
- widget-shared.go
- widget-split-column.go
- widget-todo.go
- widget-twitch-channels.go
- widget-twitch-top-games.go
- widget-utils.go
- widget-videos.go
- widget-weather.go
- widget.go
Click to show internal directories.
Click to hide internal directories.