config

package
v0.0.0-...-d6003e4 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 10 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 {
	// App is a set of properties for the application such as name, port, location, etc.
	App struct {
		Name        string
		Port        int
		Environment string
		Location    *time.Location
		Debug       bool
	}
	// CORS is a set of properties for Cross Origins Resource Sharing. It should be set to allow direct request from the external web application (from browser).
	CORS struct {
		AllowedOrigins []string
		AllowedMethods []string
		ExposedHeaders []string
	}
	// Logrus is a logger package for logging. This object contains setup properties of logrus.
	Logrus struct {
		Formatter logrus.Formatter
	}
	// JWT contains both private and public key in buffered type.
	JWT struct {
		PrivateKey []byte
		PublicKey  []byte
	}
	// BasicAuth contains credentials for basic authentication.
	BasicAuth struct {
		Username string
		Password string
	}
	// OpenTelemetry contains creds and other properties that will be needs to connect and run agent for application tracing and metrics collection.
	OpenTelemetry struct {
		Collector struct {
			Endpoint string
		}
	}
	Postgres struct {
		Host         string
		Port         int
		User         string
		Password     string
		DBName       string
		SSLMode      string
		MaxOpenConns int
		MaxIdleConns int
	}
}

Config contains collection of the properties for the application configurations.

func Get

func Get() *Config

Get returns config concrete object. It's done in singleton and thread-safe.

Jump to

Keyboard shortcuts

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