Documentation ¶
Index ¶
- type File
- type Section
- type Value
- func (v Value) Bool() bool
- func (v Value) CommaArray() (out []string)
- func (v Value) File() (*os.File, error)
- func (v Value) Int() int
- func (v Value) IsBool() bool
- func (v Value) IsCommaArray() bool
- func (v Value) IsInt() bool
- func (v Value) IsMultivalueArray() bool
- func (v Value) IsSemicolonArray() bool
- func (v Value) MultivalueArray() []string
- func (v Value) SemicolonArray() (out []string)
- func (v Value) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) DeleteSection ¶
Deletes the given key from the section.
func (File) HasSection ¶
Does the File have the given section.
func (File) PreSection ¶
Returns a Section with the key=value pairs that appear before the first section.
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
func NewSection ¶
func NewSection() *Section
func (*Section) AddValue ¶
If the key is not present, adds the key with the given value. If the key is present, add the given value as an additional line (MultivalueArray)
func (*Section) DeleteValue ¶
Deletes the given key from the section.
type Value ¶
type Value []string
Value holds the value of a Key=Value pair. If multiple lines have the same key, only the first value is used, except for with MultivalueArray.
func (Value) CommaArray ¶
Returns the value as a comma delimited array. Each output is trimmed.
func (Value) IsBool ¶
Returns if value is a bool value (only true and false are allowed). Case insensitive.
func (Value) IsCommaArray ¶
Returns if the value contains any commas, perhaps indicating that it's a comma delimited array.
func (Value) IsMultivalueArray ¶
Returns if there are multiple value with this same key.
func (Value) IsSemicolonArray ¶
Returns if the value contains any semicolons, perhaps indicating that it's a semicolon delimited array.
func (Value) MultivalueArray ¶
Returns all values with the same key.
func (Value) SemicolonArray ¶
Returns the value as a semicolon delimited array. Each output is trimmed.