tinyini

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 2

README

tinyini

tinyini is a minimalistic library for parsing INI-like configuration files.

Documentation

Overview

package tinyini provides an extremely bare-bones library for parsing INI-like configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader) (result map[string]Section, errs []error)

Parse will produce a map of Section from an io.Reader. The caller should note that Parse returns a slice of errors in the order of occurrence, so the condition for success is len(errs) == 0. Parse will parse as much as possible even when encountering errors, so result may contain something useful even if len(errs) > 0.

Types

type IniError

type IniError struct {
	Line int
	// contains filtered or unexported fields
}

IniError describes a parsing error and provides its line number.

func (*IniError) Error

func (i *IniError) Error() string

func (*IniError) Unwrap

func (i *IniError) Unwrap() error

type Section

type Section map[string][]string

Section contains all configuration key-values of a single bracketed section ("[example-section]"). All key-values may contain multiple values. The values are given in the order of occurrence.

Jump to

Keyboard shortcuts

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