config

package
v0.0.0-...-42d6aa1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright (c) 2023 Tiago Melo. All rights reserved. Use of this source code is governed by the MIT License that can be found in the LICENSE file.

Package config provides functions for reading and processing the application configuration. It reads environment variables from a file and populates a Config struct with the values. The configuration struct holds all the necessary configuration values needed by the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MongodbDatabase     string `envconfig:"MONGODB_DATABASE" required:"true"`
	MongodbHostName     string `envconfig:"MONGODB_HOST_NAME" required:"true"`
	MongodbPort         int    `envconfig:"MONGODB_PORT" required:"true"`
	MongodbTestDatabase string `envconfig:"MONGODB_TEST_DATABASE" required:"true"`
	MongodbTestHostName string `envconfig:"MONGODB_TEST_HOST_NAME" required:"true"`
	MongodbTestPort     int    `envconfig:"MONGODB_TEST_PORT" required:"true"`
	GrpcServerṔort      int    `envconfig:"GRPC_SERVER_PORT" required:"true"`
}

Config holds all the configuration needed by the application.

func Read

func Read(envFilePath string) (*Config, error)

Read reads the environment variables from the given file and returns a Config.

Jump to

Keyboard shortcuts

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