config

package
v0.0.0-...-72c8848 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 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 {
	// ListenAddr is the address to bind the local server to.
	ListenAddr string `json:"listen"`

	// LogLevel is the log level for the application.
	LogLevel string `json:"log_level"`

	// DBConnStr is the connection string for the database.
	//
	// Begain with the database type, followed by the connection string. For example:
	// - sqlite3://:memory: creates an in-memory database.
	// - sqlite3:///path/to/database.db creates a database file at the specified path.
	// - postgres://user:password@localhost:5432/dbname connects to a PostgreSQL database.
	DBConnStr string `json:"db"`
}

Config is a struct that holds the configuration for the application.

func NewConfig

func NewConfig(r io.Reader) (*Config, error)

NewConfig creates a new Config struct from the provided io.Reader. The io.Reader should contain the configuration in *json* format that can be parsed by the application.

Jump to

Keyboard shortcuts

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