ini

package module
v0.0.0-...-7c37c58 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: MIT Imports: 8 Imported by: 0

README

Ini

Build Status

Package ini is a parser for ini files implemented using the 'text/scanner' package. It can also parse the git configuration file format.

Documentation

Documentation is available at godoc.org

License

This code is free to use and distribute, under the MIT license.

Documentation

Overview

Package ini is a parser for ini files implemented using the 'text/scanner' package.

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 structure contains the data and a RWMutex for concurrency safety

func NewIni

func NewIni() *Ini

Instantiates a new Ini structure

func (*Ini) Get

func (ini *Ini) Get(section, key string) string

Get() returns the value associated to section and key. If key is not in a section, use "" If key does not exist, Get() returns an empty string.

func (*Ini) Has

func (ini *Ini) Has(section, key string) bool

Has() returns true if the ini structure has corresponding value in section/key

func (*Ini) HasSection

func (ini *Ini) HasSection(section string) bool

func (*Ini) ReadFrom

func (ini *Ini) ReadFrom(r io.Reader) (int64, error)

ReadFrom() read the ini configuration contained in the Reader r until EOF.

func (*Ini) Set

func (ini *Ini) Set(section, key, value string)

Set() sets the value of a key for a given section.

func (*Ini) WriteTo

func (ini *Ini) WriteTo(writer io.Writer) (int64, error)

WriteTo() writes the configuration in an ini format to the Writer writer.

Jump to

Keyboard shortcuts

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