config

package
v0.0.0-...-a84335b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config implements parsing and setting app configuration options

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

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

Options consist of all application configuration

var Opts *Options

Opts is the application level configuration options

func NewOptions

func NewOptions() *Options

NewOptions initializes Options with defaults

func (*Options) BasePath

func (o *Options) BasePath() string

BasePath returns the configured path of the service as specified in the BaseURL

func (*Options) BaseURL

func (o *Options) BaseURL() string

BaseURL returns the configured url of the service

func (*Options) DatabaseDriver

func (o *Options) DatabaseDriver() string

DatabaseDriver returns the configured sql dialect

func (*Options) DatabaseURL

func (o *Options) DatabaseURL() string

DatabaseURL returns the configured database url.

func (*Options) InitEmail

func (o *Options) InitEmail() string

InitEmail is an initial admin profile email to add to a new database.

func (*Options) IsHTTPS

func (o *Options) IsHTTPS() bool

IsHTTPS returns whether the service is accessed over https

func (*Options) ListenAddr

func (o *Options) ListenAddr() string

ListenAddr is the application's listen ip and port if configured to serve http

func (*Options) RootURL

func (o *Options) RootURL() string

RootURL returns the BaseURL without path

func (*Options) RunMigrations

func (o *Options) RunMigrations() bool

RunMigrations indicates if the application should run database migrations.

func (*Options) SMTPFrom

func (o *Options) SMTPFrom() string

SMTPFrom returns the configured From address for email sent by the application.

func (*Options) SMTPPass

func (o *Options) SMTPPass() string

SMTPPass returns the configured PLAIN auth password value.

func (*Options) SMTPURL

func (o *Options) SMTPURL() string

SMTPURL returns the SMTP server URL. This includes both the host and port values

func (*Options) SMTPUser

func (o *Options) SMTPUser() string

SMTPUser returns the configured PLAIN auth username value.

type Parser

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

Parser contains and produces configuration options

func NewParser

func NewParser() *Parser

NewParser initializes a new Parser with default options

func (*Parser) Opts

func (p *Parser) Opts() *Options

Opts returns the parser's resolved options

func (*Parser) ParseEnvironmentVariables

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

ParseEnvironmentVariables will update the Parser's options based on the application env

func (*Parser) ParseFile

func (p *Parser) ParseFile(f io.Reader) (*Options, error)

Jump to

Keyboard shortcuts

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