config

package
v0.0.0-...-44fde62 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package config provides connection with environment configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Telegram Telegram
	TaniFund TaniFund
	Sleep    int    `env:"SLEEP,default=60"`
	Port     string `env:"PORT,default=8080"`
}

Config holds configuration for the project.

func NewConfig

func NewConfig(env string) (*Config, error)

NewConfig creates an instance of Config. It needs the path of the env file to be used.

type TaniFund

type TaniFund struct {
	URL string `env:"TANIFUND_URL,required"`
}

TaniFund holds configuration related to TaniFund.

type Telegram

type Telegram struct {
	RecipientID int    `env:"TELEGRAM_RECIPIENT_ID,required"`
	URL         string `env:"TELEGRAM_URL,required"`
	Token       string `env:"TELEGRAM_TOKEN,required"`
}

Telegram holds configuration related to Telegram bot.

Jump to

Keyboard shortcuts

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