reflecter

package module
v0.0.0-...-00b95be Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2014 License: BSD-2-Clause, BSD-3-Clause Imports: 8 Imported by: 1

README

Reflecter

status Build Status

A library for setting an arbitrary value in a structure by reflection.

It only provides one function:

Set(cfg interface{}, sect, sub, name string, blank bool, value string)

where you can pass an arbitrary structure cfg, and sect, sub will be substructures and name an attribute that will be assigned a value.

Example

type Config structure {
    type Global structure {
        Host string
    }
}

cfg := Config{}

Set(cfg, "Global", "", "Host", false, "somehost.com")

Credits

The code of this library comes from Gcfg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(cfg interface{}, sect,
	sub, name string, blank bool, value string) error

the setter function

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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