Documentation ¶
Overview ¶
Package value handles mapping values pass into the application via various means to the settings type.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct { Set bool Pointer interface{} }
Data holds an untyped (interface{}) value which can be assigned to a bool, int, int64, uint, uint64, float64, string, or time.Duration.
func Coerce ¶
Coerce the given string into a Data type holding a value of typeOf.
Example ¶
package main import ( "fmt" "bitbucket.org/idomdavis/goconfigure/value" ) func main() { var typeOf string if v, err := value.Coerce("text", &typeOf); err != nil { fmt.Println(err) } else { fmt.Println(v) } }
Output: {true text}
func (Data) AssignTo ¶
AssignTo sets the given pointer to point to the value held by this Data type.
Example ¶
package main import ( "fmt" "bitbucket.org/idomdavis/goconfigure/value" ) func main() { var v string d := value.New("example") if err := d.AssignTo(&v); err != nil { fmt.Println(err) } fmt.Println(v) }
Output: example
Click to show internal directories.
Click to hide internal directories.