jsonconfig

package
v0.0.0-...-92059fe Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2016 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package jsonconfig defines a helper type for JSON objects to be used for configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HighlightBytePosition

func HighlightBytePosition(f io.Reader, pos int64) (line int, col int, highlight string)

Types

type Obj

type Obj map[string]interface{}

Obj is a JSON configuration map.

func ReadFile

func ReadFile(configPath string) (Obj, error)

Reads json config data from the specified open file, expanding all expressions

func (Obj) OptionalBool

func (jc Obj) OptionalBool(key string, def bool) bool

func (Obj) OptionalInt

func (jc Obj) OptionalInt(key string, def int) int

func (Obj) OptionalList

func (jc Obj) OptionalList(key string) []string

func (Obj) OptionalObject

func (jc Obj) OptionalObject(key string) Obj

func (Obj) OptionalString

func (jc Obj) OptionalString(key, def string) string

func (Obj) OptionalStringOrObject

func (jc Obj) OptionalStringOrObject(key string) interface{}

func (Obj) RequiredBool

func (jc Obj) RequiredBool(key string) bool

func (Obj) RequiredInt

func (jc Obj) RequiredInt(key string) int

func (Obj) RequiredList

func (jc Obj) RequiredList(key string) []string

func (Obj) RequiredObject

func (jc Obj) RequiredObject(key string) Obj

func (Obj) RequiredString

func (jc Obj) RequiredString(key string) string

func (Obj) RequiredStringOrObject

func (jc Obj) RequiredStringOrObject(key string) interface{}

func (Obj) Validate

func (jc Obj) Validate() error

Jump to

Keyboard shortcuts

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