config

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 11 Imported by: 2

README

config

TOML config helper for multiple packages

Install

go get -u "peterdekok.nl/gotools/config"
import "peterdekok.nl/gotools/config"

Documentation

Overview

Package config provides tools to easily add (TOML) config files to packages

The config package will load the toml file on initialization and cache it. This cache will be used to populate any config structs added to the pool by different packages. On reload (signal SIGUSR1) the file is reloaded, the cache refilled and every entry in the pool parsed again.

The file should be specified by adding a -c flag/argument to the command

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v1.0.0

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Singleton added in v1.0.0

func Singleton() *Cache

func (*Cache) Add added in v1.0.0

func (c *Cache) Add(cnf interface{})

Add a config struct to the pool

func (*Cache) Reload added in v1.0.0

func (c *Cache) Reload()

Reload the config file and parse for every individual config struct

Jump to

Keyboard shortcuts

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