config

package
v0.0.0-...-8bff5d1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 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 Config

type Config struct {
	Admins      []string
	Development bool

	Email       Email
	Memcached   Memcached
	Postgres    Postgres
	RateLimiter RateLimiter
	Redis       Redis
	Server      Server
	Session     Session
	Static      Static
	Stripe      Stripe
}

Config constains all the server configurations.

func New

func New() (Config, 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 Email

type Email struct {
	Host     string
	Port     string
	Sender   string
	Password string
}

Email holds email attributes.

type Memcached

type Memcached struct {
	Servers []string
}

Memcached is the LRU-cache configuration.

type Postgres

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

Postgres hols the database attributes.

type RateLimiter

type RateLimiter struct {
	Rate int
}

RateLimiter configuration.

type Redis

type Redis struct {
	Host     string
	Port     string
	Password string
}

Redis configuration.

type Server

type Server struct {
	Host string
	Port string
	TLS  struct {
		KeyFile  string
		CertFile string
	}
	Timeout struct {
		Read     time.Duration
		Write    time.Duration
		Shutdown time.Duration
	}
}

Server holds the server attributes.

type Session

type Session struct {
	Attempts int64
	Delay    int64
	Length   int
}

Session contains the session configuration.

type Static

type Static struct {
	FS embed.FS
}

Static contains the static file system.

type Stripe

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

Stripe hold stripe attributes

Jump to

Keyboard shortcuts

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