Working on v2
This commit is contained in:
28
old/bundle.go
Normal file
28
old/bundle.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
type Bundle map[string]interface{}
|
||||
|
||||
func (b Bundle) setValue(key string, val interface{}) {
|
||||
b[key] = val
|
||||
}
|
||||
|
||||
func (b Bundle) getBool(key string, def bool) bool {
|
||||
if v, ok := b[key].(bool); ok {
|
||||
return v
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func (b Bundle) getString(key, def string) string {
|
||||
if v, ok := b[key].(string); ok {
|
||||
return v
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func (b Bundle) getInt(key string, def int) int {
|
||||
if v, ok := b[key].(int); ok {
|
||||
return v
|
||||
}
|
||||
return def
|
||||
}
|
||||
Reference in New Issue
Block a user