Package wini

import ""

Overview ▾

Package wini provides an ini-like file parser. Namely, a wini parser.

A wini file is very similar to a traditional ini file, except it doesn't have any quoting mechanism, uses ':=' instead of '=', and allows simple variables.

Variables are extremely useful when theming.

We also do our best to provide helpful error messages, so we can more precisely slap the user when they've gone wrong :-)

This package is heavily inspired by glacjay's "goini" package:

type Data

type Data struct {
    // contains filtered or unexported fields

func Parse

func Parse(filename string) (*Data, error)

func (*Data) GetKey

func (d *Data) GetKey(section, keyName string) *Key

func (*Data) Keys

func (d *Data) Keys(section string) []Key

func (*Data) Sections

func (d *Data) Sections() []string

type Key

type Key struct {
    // contains filtered or unexported fields

func (Key) Bools

func (k Key) Bools() ([]bool, error)

func (Key) Err

func (k Key) Err(formatted string, vals ...interface{}) error

func (Key) Floats

func (k Key) Floats() ([]float64, error)

func (Key) Ints

func (k Key) Ints() ([]int, error)

func (Key) Name

func (k Key) Name() string

func (Key) String

func (k Key) String() string

func (Key) Strings

func (k Key) Strings() []string

type Section

type Section map[string]Value

type Value

type Value []string