config

package
v0.0.0-...-15895bd Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Database DatabaseConfiguration
	Server   ServerConfiguration
	Email    EmailConfiguration
	Stripe   StripeConfiguration
}

Configuration constains all the server configurations.

func New

func New() (*Configuration, error)

New sets up the configuration with the values the user gave. Defaults and env variables are placed at the end to make the config easier to read.

type DatabaseConfiguration

type DatabaseConfiguration struct {
	Username string
	Password string
	Host     string
	Port     string
	Name     string
	SSLMode  string
}

DatabaseConfiguration hols the database attributes.

type EmailConfiguration

type EmailConfiguration struct {
	Host        string
	Port        string
	Sender      string
	Password    string
	AdminEmails string
}

EmailConfiguration holds email attributes.

type ServerConfiguration

type ServerConfiguration struct {
	Host    string
	Port    string
	Timeout struct {
		Read     time.Duration
		Write    time.Duration
		Shutdown time.Duration
	}
}

ServerConfiguration holds the server attributes.

type StripeConfiguration

type StripeConfiguration struct {
	SecretKey string
	Logger    struct {
		Level stripe.Level
	}
}

StripeConfiguration hold stripe attributes

Jump to

Keyboard shortcuts

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