config

package
v0.0.0-...-271498a Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 5 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 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 RDBMS

	// redis database
	REDIS REDIS

	// mongo database
	MongoDB MongoDB
}

DatabaseConfig - all database variables

func Database

func Database() DatabaseConfig

Database - all DB variables

func DatabaseMongo

func DatabaseMongo() DatabaseConfig

DatabaseMongo - all MongoDB variables

func DatabaseRDBMS

func DatabaseRDBMS() DatabaseConfig

DatabaseRDBMS - all RDBMS variables

func DatabaseRedis

func DatabaseRedis() DatabaseConfig

DatabaseRedis - all REDIS DB variables

type LoggerConfig

type LoggerConfig struct {
	SentryDsn string
}

LoggerConfig ...

func Logger

func Logger() LoggerConfig

Logger ...

type MongoDB

type MongoDB struct {
	Activate string
	Env      struct {
		AppName  string
		URI      string
		PoolSize uint64
		PoolMon  string
		ConnTTL  int
	}
}

MongoDB - mongo database variables

type RDBMS

type 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
	}
}

RDBMS - relational database variables

type REDIS

type REDIS struct {
	Activate string
	Env      struct {
		Host string
		Port string
	}
	Conn struct {
		PoolSize int
		ConnTTL  int
	}
}

REDIS - redis database variables

type SecurityConfig

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

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

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