config

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEnvVar = "ACME_CONFIG"

DefaultEnvVar is the default environment variable the points to the config file

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DSN is the data source name (format: https://github.com/go-sql-driver/mysql/#dsn-data-source-name)
	DSN string

	// Address is the IP address and port to bind this rest to
	Address string

	// BasePrice is the price of registration
	BasePrice float64

	// ExchangeRateBaseURL is the server and protocol part of the URL from which to load the exchange rate
	ExchangeRateBaseURL string

	// ExchangeRateAPIKey is the API for the exchange rate API
	ExchangeRateAPIKey string
	// contains filtered or unexported fields
}

Config defines the JSON format for the config file

func Load

func Load() (*Config, error)

Load returns the config loaded from environment

func (*Config) BindAddress

func (c *Config) BindAddress() string

BindAddress returns the host and port this service should bind to

func (*Config) DataDSN

func (c *Config) DataDSN() string

DataDSN returns the DSN

func (*Config) ExchangeAPIKey

func (c *Config) ExchangeAPIKey() string

ExchangeAPIKey returns the DSN

func (*Config) ExchangeBaseURL

func (c *Config) ExchangeBaseURL() string

ExchangeBaseURL returns the Base URL from which we can load exchange rates

func (*Config) Logger

func (c *Config) Logger() logging.Logger

Logger returns a reference to the singleton logger

func (*Config) RegistrationBasePrice

func (c *Config) RegistrationBasePrice() float64

RegistrationBasePrice returns the base price for registrations

Jump to

Keyboard shortcuts

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