config

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 5 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Database DatabaseConfig
	Logger   LoggerConfig
	Server   ServerConfig
	Security SecurityConfig
}

Configuration - server and db configuration variables

func Config

func Config() Configuration

Config - load all the configurations

type DatabaseConfig

type DatabaseConfig struct {
	// relational database
	RDBMS struct {
		Activate string
		Env      struct {
			Driver   string
			Host     string
			Port     string
			TimeZone string
		}
		Access struct {
			DbName string
			User   string
			Pass   string
		}
		Ssl struct {
			Sslmode string
		}
		Conn struct {
			MaxIdleConns    int
			MaxOpenConns    int
			ConnMaxLifetime time.Duration
		}
		Log struct {
			LogLevel int
		}
	}

	// redis database
	REDIS struct {
		Activate string
		Env      struct {
			Host string
			Port string
		}
		Conn struct {
			PoolSize int
			ConnTTL  int
		}
	}

	// mongo database
	MongoDB struct {
		Activate string
		Env      struct {
			URI      string
			PoolSize uint64
			ConnTTL  int
		}
	}
}

DatabaseConfig - database variables

func Database added in v1.3.0

func Database() DatabaseConfig

Database - all DB variables

type LoggerConfig added in v1.2.4

type LoggerConfig struct {
	SentryDsn string
}

LoggerConfig ...

func Logger added in v1.3.0

func Logger() LoggerConfig

Logger ...

type SecurityConfig added in v1.3.0

type SecurityConfig struct {
	BasicAuth struct {
		Username string
		Password string
	}
	JWT struct {
		AccessKey     string
		RefreshKey    string
		AccessKeyTTL  int
		RefreshKeyTTL int
	}
	HashPass struct {
		Memory      uint32
		Iterations  uint32
		Parallelism uint8
		SaltLength  uint32
		KeyLength   uint32
	}
	Firewall struct {
		ListType string
		IP       string
	}
	TrustedIP string
}

SecurityConfig ...

func Security added in v1.3.0

func Security() SecurityConfig

Security - configs for generating tokens and hashes

type ServerConfig

type ServerConfig struct {
	ServerPort string // public port of server
	ServerEnv  string
}

ServerConfig ...

func Server added in v1.3.0

func Server() ServerConfig

Server - port and env

Jump to

Keyboard shortcuts

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