option

package
v0.0.0-...-a54a33a Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: AGPL-3.0 Imports: 1 Imported by: 25

Documentation

Overview

Package option helps to read values from option maps.

This package is a work in progress and makes no API stability promises.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(opts map[string]interface{}, field string) (value bool, ok bool, err error)

Bool returns the field passed as boolean in value, ok if exists.

func Hash

func Hash(opts map[string]interface{}, field string) (value map[string]interface{}, ok bool, err error)

Hash returns the field passed as a map of interfaces in value, ok if exists.

func HashString

func HashString(opts map[string]interface{}, field string) (value map[string]string, ok bool, err error)

HashString returns the field passed as a map of strings in value, ok if exists.

func Int

func Int(opts map[string]interface{}, field string) (value int, ok bool, err error)

Int returns the field passed as int in value, ok if exists.

func SliceHash

func SliceHash(opts map[string]interface{}, field string) (value []map[string]interface{}, ok bool, err error)

SliceHash returns the field passed as a slice of map of interfaces in value, ok if exists.

func SliceHashString

func SliceHashString(opts map[string]interface{}, field string) (value []map[string]string, ok bool, err error)

SliceHashString returns the field passed as a slice of map of strings in value, ok if exists.

func SliceString

func SliceString(opts map[string]interface{}, field string) (value []string, ok bool, err error)

SliceString returns the field passed as a slice of strings in value, ok if exists.

func String

func String(opts map[string]interface{}, field string) (value string, ok bool, err error)

String returns the field passed as string in value, ok if exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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