config

package
v0.0.0-...-10cef3e Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 2 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 {
	Database struct {
		Host     string `yaml:"host"`
		Port     string `yaml:"port"`
		User     string `yaml:"user"`
		Password string `yaml:"password"`
		Name     string `yaml:"name"`
	}

	Server struct {
		Host string `yaml:"host"`
		Port string `yaml:"port"`
	}

	Api struct {
		Jwt string `yaml:"jwt"`
	}
}

Config is the struct behind the config.yml file. It holds basic configurations for the server to run

func NewConfig

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

NewConfig returns a new Config object that will be read from the the configPath provided

func (*Config) JwtSecret

func (c *Config) JwtSecret() string

JwtSecret is a utility function that returns config.Api.Jwt Added to ease the manipulation of the config struct.

Jump to

Keyboard shortcuts

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