ini

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ini provides functionality to parse and read properties from INI files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type INI

type INI struct {
	// contains filtered or unexported fields
}

INI represents a parsed INI file in memory.

func New

func New(path string) (*INI, error)

New returns an INI file given a path to the file. An error is returned if the file can't be parsed.

func (*INI) Sections

func (i *INI) Sections() []string

Sections returns the names of **non-empty** sections in the file.

For example, the method returns ["paths", "servers"] if the file's content is:

app_mode = development
[paths]
data = /home/git/grafana
[server]
protocol = http
http_port = 9999

Jump to

Keyboard shortcuts

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