import "github.com/cognusion/go-jar/mapmap"
- type MapMap
- func NewMapMap() *MapMap
- func NewMapMapWithMapNames(idMap, endpointMap string) *MapMap
- func (o *MapMap) Get(name, key string) string
- func (o *MapMap) GetURLRoute(routeName string) *URLRoute
- func (o *MapMap) Load(name, filename string) error
- func (o *MapMap) Set(name string, newmap map[string]string)
- func (o *MapMap) Size() int
- type URLRoute
type MapMap struct {
sync.Mutex // used ONLY BY WRITERS
// contains filtered or unexported fields
}MapMap is essentially a goro-safe map[string]map[string]string specialized for handling multi-URL "URL Routes". MapMap is optimized for read-mostly patterns
func NewMapMap() *MapMapNewMapMap returns an initiaized MapMap
func NewMapMapWithMapNames(idMap, endpointMap string) *MapMapNewMapMapWithMapNames returns an initiaized MapMap, with the map names set to non-default values.
func (o *MapMap) Get(name, key string) stringGet takes a map name and key, and returns the stored value or an empty string
func (*MapMap) GetURLRoute
func (o *MapMap) GetURLRoute(routeName string) *URLRouteGetURLRoute takes a routeName (first block of a hostname) and may return a reconstituted URLRoute.
The Name is populated by the routeName requested.
The ID field is pulled from the value of the ids map with the routeName as key.
The Endpoint field is pulled from the value of the endpoints map with the routeName as key.
Partial results are returns as applicable.
func (o *MapMap) Load(name, filename string) errorLoad takes an "Org Map" name and a filename, and builds a new "Org Map" from the file, .Set()ing it
func (o *MapMap) Set(name string, newmap map[string]string)Set takes an "Org Map" name, and replaces its string map with the provided one
func (o *MapMap) Size() intSize returns the number of toplevel keys in the MapMap
type URLRoute struct {
Name string
ID string
Endpoint string
}URLRoute is an informative structure
Generated by godoc2md