Improve inline documetation
This commit is contained in:
parent
d77149c9ef
commit
f654f432ba
28
conf.go
28
conf.go
|
@ -1,8 +1,32 @@
|
||||||
// This package implements a parser for configuration files.
|
// This package implements a parser for configuration files.
|
||||||
// This allows easy reading and writing of structured configuration files.
|
// This allows easy reading and writing of structured configuration files.
|
||||||
//
|
//
|
||||||
// You can get some example configuration files and documentation at
|
// Given the configuration file:
|
||||||
// http://code.google.com/p/goconf/
|
//
|
||||||
|
// [default]
|
||||||
|
// host = example.com
|
||||||
|
// port = 443
|
||||||
|
// php = on
|
||||||
|
//
|
||||||
|
// [service-1]
|
||||||
|
// host = s1.example.com
|
||||||
|
// allow-writing = false
|
||||||
|
//
|
||||||
|
// To read this configuration file, do:
|
||||||
|
//
|
||||||
|
// c, err := conf.ReadConfigFile("server.conf")
|
||||||
|
// c.GetString("default", "host") // returns example.com
|
||||||
|
// c.GetInt("", "port") // returns 443 (assumes "default")
|
||||||
|
// c.GetBool("", "php") // returns true
|
||||||
|
// c.GetString("service-1", "host") // returns s1.example.com
|
||||||
|
// c.GetBool("service-1","allow-writing") // returns false
|
||||||
|
// c.GetInt("service-1", "port") // returns 0 and a GetError
|
||||||
|
//
|
||||||
|
// Note that all section and option names are case insensitive. All values are case
|
||||||
|
// sensitive.
|
||||||
|
//
|
||||||
|
// Goconfig's string substitution syntax has not been removed. However, it may be
|
||||||
|
// taken out or modified in the future.
|
||||||
package conf
|
package conf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in New Issue