zazabul

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 4 Imported by: 12

README

zazabul

A configuration file format

GoDoc

Sample Configuration

// email is used for communication
// email must follow the format for email ie username@host.ext
// email is compulsory
email: banker@banban.com

// region should be gotten from google cloud documentation
region: us-central1

// zone should be gotten from google cloud documentation
// zone usually derived from the regions and ending with -a or -b or -c
zone: us-central1-a

Notes

For grouping, use different files.

License

MIT

Documentation

Overview

zazabul: A configuration file format

Sample

// email is used for communication
// email must follow the format for email ie username@host.ext
// email is compulsory
email: banker@banban.com

// region should be gotten from google cloud documentation
region: us-central1

// zone should be gotten from google cloud documentation
// zone usually derived from the regions and ending with -a or -b or -c
zone: us-central1-a

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Items []ConfigItem
}

func LoadConfigFile

func LoadConfigFile(path string) (Config, error)

Returns a config written in the zazabul format.

func ParseConfig

func ParseConfig(str string) (Config, error)

Default (most comfortable) way of creating a Config object.

func (*Config) Get

func (conf *Config) Get(configName string) string

func (*Config) Update

func (conf *Config) Update(items map[string]string)

Update does not add a new entry. To do that you need to add it to the template you used to create the Config object.

func (*Config) Write

func (conf *Config) Write(path string) error

Writes the Config to a file whose path was given as path

type ConfigItem

type ConfigItem struct {
	Name    string
	Comment string
	Value   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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