settings

package
v0.0.0-...-0bd2313 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIURL

func APIURL() string

func ConfigFileUsed

func ConfigFileUsed() string

func Init

func Init(cfgFile string) error

Types

type Config

type Config struct {
	Mode  string
	Serve struct {
		Domain         string
		APIURL         string
		StartupMessage bool
		Public         struct {
			Port string
			Host string
		}
	}
	SQL struct {
		DSN    string
		Driver string
	}
	Argon2 struct {
		Memory      uint32
		Iterations  uint32
		Parallelism uint8
		SaltLength  uint32
		KeyLength   uint32
	}
	Session struct {
		Cookie   string
		Lifespan time.Duration
	}
	OAuth struct {
		StateCookie    string
		CookieLifespan time.Duration
		Google         oauth2.Config
		GitHub         oauth2.Config
		LinkedIn       oauth2.Config
	}
	Client struct {
		WebURL string
	}
	Mail struct {
		SMTP struct {
			From       string
			Password   string
			Host, Port string
		}
	}
	Cache struct {
		Redis struct {
			DSN      string
			Password string
			DB       int
		}
	}
	CORS struct {
		AllowedOrigins   []string
		AllowedMethods   []string
		AllowedHeaders   []string
		AllowCredentials bool
	}
	External struct {
		IPGeoLocation struct {
			APIKey string
		}
	}
	// contains filtered or unexported fields
}

func New

func New(l *xlog.Logger) *Config

func (*Config) IsDevelopment

func (c *Config) IsDevelopment() bool

func (*Config) IsMode

func (c *Config) IsMode(mode string) bool

func (*Config) IsProduction

func (c *Config) IsProduction() bool

func (*Config) IsStaging

func (c *Config) IsStaging() bool

func (*Config) PublicListenOn

func (c *Config) PublicListenOn() string

type Provider

type Provider interface {
	Settings() *Config
}

Jump to

Keyboard shortcuts

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