config

package
v0.0.0-...-3c93229 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env            string           `json:"env"`
	PostgreSQL     PostgreSQLConfig `json:"postgreSQL"`
	JWT            JWTConfig        `json:"jwt"`
	RedisDB        RedisConfig      `json:"RedisDB"`
	Port           string           `json:"port"`
	AllowedOrigins []string         `json:"allowedOrigins"`
	CaptchaSecret  string           `json:"captchaSecret"`
}

Config holds the configuration for the whole API

func New

func New(path string) (Config, error)

New returns a Config struct based on a given JSON file

type JWTConfig

type JWTConfig struct {
	Secret     string `json:"secret"`
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

JWTConfig holds the configuration for the JWT authentication

type PostgreSQLConfig

type PostgreSQLConfig struct {
	Host     string `json:"host"`
	Port     string `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	Database string `json:"database"`
	Timezone string `json:"timezone"`
}

PostgreSQLConfig holds the configuration for the Postgres database

type RedisConfig

type RedisConfig struct {
	Host     string `json:"host"`
	Port     string `json:"port"`
	Password string `json:"password"`
}

RedisConfig holds the configuration for the Redis database

Jump to

Keyboard shortcuts

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