config

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PollingInterval defines how often a single feed is re-synced.
	// If a feed was synced at T, it will be eligible again at T + PollingInterval.
	PollingInterval = 10 * time.Minute

	// IdleSleepTime defines how long the worker sleeps when no feeds are due for syncing.
	IdleSleepTime = 10 * time.Second

	// ETagTTL defines the cache duration for API endpoints.
	// This is set below half the PollingInterval (the Nyquist limit) to ensure clients never miss an update.
	ETagTTL = 150 * time.Second

	// lock duration
	DefaultLockDuration = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ApplicationName string `required:"false" default:"'News Deframer Browser Extension Service'"`

	// HTTP Port
	Port string `env:"PORT" envDefault:"8080"`

	// Gorm DNS
	DSN string `env:"DSN" envDefault:"host=postgres user=deframer password=deframer dbname=deframer port=5432 sslmode=disable"`

	BasicAuthUser            string `env:"BASIC_AUTH_USER" envDefault:""`
	BasicAuthPassword        string `env:"BASIC_AUTH_PASSWORD" envDefault:""`
	CORSAllowedOrigins       string `env:"CORS_ALLOWED_ORIGINS"`
	RedirectWebRequest404URL string `env:"REDIRECT_WEBREQUEST_404_URL" envDefault:""`

	LLM_Type    LLMType `env:"LLM_TYPE" envDefault:"dummy"`
	LLM_Model   string  `env:"LLM_MODEL" envDefault:""`
	LLM_APIKey  string  `env:"LLM_API_KEY" envDefault:""`
	LLM_BaseURL string  `env:"LLM_BASE_URL" envDefault:""`

	DebugLog        bool `env:"DEBUG_LOG" envDefault:"false"`
	DatabaseLogging bool `env:"DATABASE_LOGGING" envDefault:"false"`
}

func Load

func Load() (*Config, error)

type LLMType

type LLMType int
const (
	Dummy LLMType = iota
	Fail
	Gemini
	OpenAI
)

func (*LLMType) UnmarshalText

func (t *LLMType) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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