luna

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const AUTH_RATE_LIMIT_MAX_ATTEMPTS = 5
View Source
const AUTH_RATE_LIMIT_WINDOW = 5 * time.Minute
View Source
const AUTH_SESSION_COOKIE_NAME = "session_token"
View Source
const AUTH_TIMESTAMP_LENGTH = 4 // uint32
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

func LoadDotEnv(path string) error

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 LoadDotEnvIfExists(path string) error

func Main

func Main() int

func NotificationsEnabledForWidget added in v0.1.5

func NotificationsEnabledForWidget(widgetType string) bool

func SendAppriseNotification added in v0.1.5

func SendAppriseNotification(settings notificationSettings, title string, body string, notifyType string) error

func SendWidgetNotification added in v0.1.5

func SendWidgetNotification(widgetType string, title string, body string, notifyType string)

func ShouldUseGenericNotifications added in v0.1.5

func ShouldUseGenericNotifications(widgetType string) bool

func StringSetChanged added in v0.1.5

func StringSetChanged(previous, current map[string]struct{}) bool

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:

  1. Create a new file: market-provider-<name>.go
  2. Implement this interface
  3. 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 SearchBang struct {
	Title    string
	Shortcut string
	URL      string
}

type SiteStatusRequest

type SiteStatusRequest struct {
	DefaultURL    string        `yaml:"url"`
	CheckURL      string        `yaml:"check-url"`
	AllowInsecure bool          `yaml:"allow-insecure"`
	Timeout       durationField `yaml:"timeout"`
	BasicAuth     struct {
		Username string `yaml:"username"`
		Password string `yaml:"password"`
	} `yaml:"basic-auth"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL