wini

package
v0.0.0-...-5f9e87e Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: BSD-3-Clause Imports: 8 Imported by: 3

Documentation

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: https://github.com/glacjay/goini

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Jump to

Keyboard shortcuts

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