config

package
v1.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	Key   string
	Value interface{}
}

Option contains a key to value map of a single option. It may be used to output debug strings.

type Options

type Options struct {
	HTTPS bool
	// contains filtered or unexported fields
}

Options contains configuration options.

var Opts *Options

Opts holds parsed configuration options.

func NewOptions

func NewOptions() *Options

NewOptions returns Options with default values.

func (*Options) AdminPassword

func (o *Options) AdminPassword() string

AdminPassword returns the admin password if defined.

func (*Options) AdminUsername

func (o *Options) AdminUsername() string

AdminUsername returns the admin username if defined.

func (*Options) AuthProxyHeader

func (o *Options) AuthProxyHeader() string

AuthProxyHeader returns an HTTP header name that contains username for authentication using auth proxy.

func (*Options) BasePath

func (o *Options) BasePath() string

BasePath returns the application base path according to the base URL.

func (*Options) BaseURL

func (o *Options) BaseURL() string

BaseURL returns the application base URL with path.

func (*Options) BatchSize

func (o *Options) BatchSize() int

BatchSize returns the number of feeds to send for background processing.

func (*Options) CertDomain

func (o *Options) CertDomain() string

CertDomain returns the domain to use for Let's Encrypt certificate.

func (*Options) CertFile

func (o *Options) CertFile() string

CertFile returns the SSL certificate filename if any.

func (*Options) CertKeyFile

func (o *Options) CertKeyFile() string

CertKeyFile returns the private key filename for custom SSL certificate.

func (*Options) CleanupArchiveBatchSize

func (o *Options) CleanupArchiveBatchSize() int

CleanupArchiveBatchSize returns the number of entries to archive for each interval.

func (*Options) CleanupArchiveReadDays

func (o *Options) CleanupArchiveReadDays() int

CleanupArchiveReadDays returns the number of days after which marking read items as removed.

func (*Options) CleanupArchiveUnreadDays

func (o *Options) CleanupArchiveUnreadDays() int

CleanupArchiveUnreadDays returns the number of days after which marking unread items as removed.

func (*Options) CleanupFrequencyHours

func (o *Options) CleanupFrequencyHours() int

CleanupFrequencyHours returns the interval in hours for cleanup jobs.

func (*Options) CleanupRemoveSessionsDays

func (o *Options) CleanupRemoveSessionsDays() int

CleanupRemoveSessionsDays returns the number of days after which to remove sessions.

func (*Options) CreateAdmin

func (o *Options) CreateAdmin() bool

CreateAdmin returns true if the environment variable CREATE_ADMIN is not empty.

func (*Options) DatabaseConnectionLifetime

func (o *Options) DatabaseConnectionLifetime() time.Duration

DatabaseConnectionLifetime returns the maximum amount of time a connection may be reused.

func (*Options) DatabaseMaxConns

func (o *Options) DatabaseMaxConns() int

DatabaseMaxConns returns the maximum number of database connections.

func (*Options) DatabaseMinConns

func (o *Options) DatabaseMinConns() int

DatabaseMinConns returns the minimum number of database connections.

func (*Options) DatabaseURL

func (o *Options) DatabaseURL() string

DatabaseURL returns the database URL.

func (*Options) FetchYouTubeWatchTime

func (o *Options) FetchYouTubeWatchTime() bool

FetchYouTubeWatchTime returns true if the YouTube video duration should be fetched and used as a reading time.

func (*Options) HTTPClientMaxBodySize

func (o *Options) HTTPClientMaxBodySize() int64

HTTPClientMaxBodySize returns the number of bytes allowed for the HTTP client to transfer.

func (*Options) HTTPClientProxy

func (o *Options) HTTPClientProxy() string

HTTPClientProxy returns the proxy URL for HTTP client.

func (*Options) HTTPClientTimeout

func (o *Options) HTTPClientTimeout() int

HTTPClientTimeout returns the time limit in seconds before the HTTP client cancel the request.

func (*Options) HTTPClientUserAgent

func (o *Options) HTTPClientUserAgent() string

HTTPClientUserAgent returns the global User-Agent header for miniflux.

func (*Options) HTTPServerTimeout

func (o *Options) HTTPServerTimeout() int

HTTPServerTimeout returns the time limit in seconds before the HTTP server cancel the request.

func (*Options) HasDebugMode

func (o *Options) HasDebugMode() bool

HasDebugMode returns true if debug mode is enabled.

func (*Options) HasHSTS

func (o *Options) HasHSTS() bool

HasHSTS returns true if HTTP Strict Transport Security is enabled.

func (*Options) HasHTTPClientProxyConfigured

func (o *Options) HasHTTPClientProxyConfigured() bool

HasHTTPClientProxyConfigured returns true if the HTTP proxy is configured.

func (*Options) HasHTTPService

func (o *Options) HasHTTPService() bool

HasHTTPService returns true if the HTTP service is enabled.

func (*Options) HasMaintenanceMode

func (o *Options) HasMaintenanceMode() bool

HasMaintenanceMode returns true if maintenance mode is enabled.

func (*Options) HasMetricsCollector

func (o *Options) HasMetricsCollector() bool

HasMetricsCollector returns true if metrics collection is enabled.

func (*Options) HasSchedulerService

func (o *Options) HasSchedulerService() bool

HasSchedulerService returns true if the scheduler service is enabled.

func (*Options) HasServerTimingHeader

func (o *Options) HasServerTimingHeader() bool

HasServerTimingHeader returns true if server-timing headers enabled.

func (*Options) HasWatchdog

func (o *Options) HasWatchdog() bool

HasWatchdog returns true if the systemd watchdog is enabled.

func (*Options) InvidiousInstance

func (o *Options) InvidiousInstance() string

InvidiousInstance returns the invidious instance used by miniflux

func (*Options) IsAuthProxyUserCreationAllowed

func (o *Options) IsAuthProxyUserCreationAllowed() bool

IsAuthProxyUserCreationAllowed returns true if user creation is allowed for users authenticated using auth proxy.

func (*Options) IsDefaultDatabaseURL

func (o *Options) IsDefaultDatabaseURL() bool

IsDefaultDatabaseURL returns true if the default database URL is used.

func (*Options) IsOAuth2UserCreationAllowed

func (o *Options) IsOAuth2UserCreationAllowed() bool

IsOAuth2UserCreationAllowed returns true if user creation is allowed for OAuth2 users.

func (*Options) ListenAddr

func (o *Options) ListenAddr() string

ListenAddr returns the listen address for the HTTP server.

func (*Options) LogDateTime

func (o *Options) LogDateTime() bool

LogDateTime returns true if the date/time should be displayed in log messages.

func (*Options) MaintenanceMessage

func (o *Options) MaintenanceMessage() string

MaintenanceMessage returns maintenance message.

func (*Options) MetricsAllowedNetworks

func (o *Options) MetricsAllowedNetworks() []string

MetricsAllowedNetworks returns the list of networks allowed to connect to the metrics endpoint.

func (*Options) MetricsPassword

func (o *Options) MetricsPassword() string

func (*Options) MetricsRefreshInterval

func (o *Options) MetricsRefreshInterval() int

MetricsRefreshInterval returns the refresh interval in seconds.

func (*Options) MetricsUsername

func (o *Options) MetricsUsername() string

func (*Options) OAuth2ClientID

func (o *Options) OAuth2ClientID() string

OAuth2ClientID returns the OAuth2 Client ID.

func (*Options) OAuth2ClientSecret

func (o *Options) OAuth2ClientSecret() string

OAuth2ClientSecret returns the OAuth2 client secret.

func (*Options) OAuth2OidcDiscoveryEndpoint

func (o *Options) OAuth2OidcDiscoveryEndpoint() string

OAuth2OidcDiscoveryEndpoint returns the OAuth2 OIDC discovery endpoint.

func (*Options) OAuth2Provider

func (o *Options) OAuth2Provider() string

OAuth2Provider returns the name of the OAuth2 provider configured.

func (*Options) OAuth2RedirectURL

func (o *Options) OAuth2RedirectURL() string

OAuth2RedirectURL returns the OAuth2 redirect URL.

func (*Options) PocketConsumerKey

func (o *Options) PocketConsumerKey(defaultValue string) string

PocketConsumerKey returns the Pocket Consumer Key if configured.

func (*Options) PollingFrequency

func (o *Options) PollingFrequency() int

PollingFrequency returns the interval to refresh feeds in the background.

func (*Options) PollingParsingErrorLimit

func (o *Options) PollingParsingErrorLimit() int

PollingParsingErrorLimit returns the limit of errors when to stop polling.

func (*Options) PollingScheduler

func (o *Options) PollingScheduler() string

PollingScheduler returns the scheduler used for polling feeds.

func (*Options) ProxyHTTPClientTimeout

func (o *Options) ProxyHTTPClientTimeout() int

ProxyHTTPClientTimeout returns the time limit in seconds before the proxy HTTP client cancel the request.

func (*Options) ProxyMediaTypes

func (o *Options) ProxyMediaTypes() []string

ProxyMediaTypes returns a slice of media types to proxy.

func (*Options) ProxyOption

func (o *Options) ProxyOption() string

ProxyOption returns "none" to never proxy, "http-only" to proxy non-HTTPS, "all" to always proxy.

func (*Options) ProxyPrivateKey

func (o *Options) ProxyPrivateKey() []byte

ProxyPrivateKey returns the private key used by the media proxy

func (*Options) ProxyUrl

func (o *Options) ProxyUrl() string

ProxyUrl returns a string of a URL to use to proxy image requests

func (*Options) RootURL

func (o *Options) RootURL() string

RootURL returns the base URL without path.

func (*Options) RunMigrations

func (o *Options) RunMigrations() bool

RunMigrations returns true if the environment variable RUN_MIGRATIONS is not empty.

func (*Options) SchedulerEntryFrequencyMaxInterval

func (o *Options) SchedulerEntryFrequencyMaxInterval() int

SchedulerEntryFrequencyMaxInterval returns the maximum interval in minutes for the entry frequency scheduler.

func (*Options) SchedulerEntryFrequencyMinInterval

func (o *Options) SchedulerEntryFrequencyMinInterval() int

SchedulerEntryFrequencyMinInterval returns the minimum interval in minutes for the entry frequency scheduler.

func (*Options) SortedOptions

func (o *Options) SortedOptions(redactSecret bool) []*Option

SortedOptions returns options as a list of key value pairs, sorted by keys.

func (*Options) String

func (o *Options) String() string

func (*Options) WorkerPoolSize

func (o *Options) WorkerPoolSize() int

WorkerPoolSize returns the number of background worker.

func (*Options) YouTubeEmbedUrlOverride

func (o *Options) YouTubeEmbedUrlOverride() string

YouTubeEmbedUrlOverride returns YouTube URL which will be used for embeds

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles configuration parsing.

func NewParser

func NewParser() *Parser

NewParser returns a new Parser.

func (*Parser) ParseEnvironmentVariables

func (p *Parser) ParseEnvironmentVariables() (*Options, error)

ParseEnvironmentVariables loads configuration values from environment variables.

func (*Parser) ParseFile

func (p *Parser) ParseFile(filename string) (*Options, error)

ParseFile loads configuration values from a local file.

Jump to

Keyboard shortcuts

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