config

package
v0.0.0-...-87fb169 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToGetUerConfigDir  = errors.New("failed to get user config dir")
	ErrFailedToCreateConfigDir  = errors.New("failed to create config dir")
	ErrFailedToCreateConfigFile = errors.New("failed to create config file")
	ErrConfigAlreadyExists      = errors.New("config file already exists")
)
View Source
var (
	ErrFailedToReadConfig      = errors.New("failed to read config file")
	ErrFailedToUnmarshalConfig = errors.New("failed to unmarshal config")
)
View Source
var ErrFailedToMarshalConfig = errors.New("failed to marshal config")

Functions

func InitializeConfig

func InitializeConfig() error

Types

type Config

type Config struct {
	Server   Server   `toml:"server"`
	Database Database `toml:"database"`
}

func GetConfig

func GetConfig() (*Config, error)

type Database

type Database struct {
	Host     string `toml:"host" comment:"Address where the database is hosted"`
	Port     int16  `toml:"port"`
	Username string `toml:"username"`
	Password string `toml:"password"`
	Name     string `toml:"name" comment:"Name of the database where you want SecurePaw to store its data'"`
}

type Server

type Server struct {
	Address string `toml:"address"`
	Port    int16  `toml:"port" comment:"Port on which you want to run the SecurePaw server"`
}

Jump to

Keyboard shortcuts

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