config

package
v0.0.0-...-a6714d8 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package config contains some simple handling of a configuration-file which is used by the server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// Settings contains the key-value pairs from the named file
	Settings map[string]string
}

Reader contains the values we've read from the configuration-file.

func New

func New(filename string) (*Reader, error)

New opens the given file, and returns a reader-structure with the specified contents.

func (*Reader) Get

func (r *Reader) Get(name string) string

Get returns the value of the given configuration key, if any.

func (*Reader) GetWithDefault

func (r *Reader) GetWithDefault(name string, value string) string

GetWithDefault returns the value of the given configuration key, if it is present, otherwise it returns the supplied default value.

Jump to

Keyboard shortcuts

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