config

package
v0.0.0-...-c62f299 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

defines config for the application

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Mode string `mapstructure:"mode"`
	// Address(es) (comma-separated) of server(s)
	Addr     string `mapstructure:"uri"`
	Username string
	Password string
	Ttl      int64 `mapstructure:"ttl"`
}

func CacheProvider

func CacheProvider(cfg *Config) *Cache

type Config

type Config struct {
	Server       *Server       `mapstructure:"server"`
	Database     *Database     `mapstructure:"database"`
	Imagor       *Imagor       `mapstructure:"imagor"`
	Nats         *Nats         `mapstructure:"nats"`
	OauthSecrets *OauthSecrets `mapstructure:"oauth"`
	Cache        *Cache        `mapstructure:"cache"`
}

type Database

type Database struct {
	Driver        string `mapstructure:"driver"`
	Uri           string `mapstructure:"uri"`
	EncryptionKey string `mapstructure:"encryptionKey"`
}

func DatabaseProvider

func DatabaseProvider(cfg *Config) *Database

type GoogleOauth

type GoogleOauth struct {
	SecretsFile string `mapstructure:"secretsFile"`
	AppId       string `mapstructure:"appId"`
	RedirectUri string `mapstructure:"redirectUri"`
}

type Imagor

type Imagor struct {
	Url string `mapstructure:"url"`
}

type Nats

type Nats struct {
	Url       string `mapstructure:"url"`
	InProcess bool   `mapstructure:"inProcess"`
}

func NatsProvider

func NatsProvider(cfg *Config) *Nats

type OauthSecrets

type OauthSecrets struct {
	Google *GoogleOauth `mapstructure:"google"`
}

type Server

type Server struct {
	Address           string `mapstructure:"address"`
	Environment       string `mapstructure:"environment"`
	ServerUrl         string `mapstructure:"serverUrl"`
	InternalServerUrl string `mapstructure:"internalServerUrl"`
	SecretKey         string `mapstructure:"secretKey"`
	FormbeeKey        string `mapstructure:"formbeeKey"`
	SingleEventMode   bool   `mapstructure:"singleEventMode"`
	DisableSignups    bool   `mapstructure:"disableSignups"`
}

Jump to

Keyboard shortcuts

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