예제 #1
0
func (a Area) String() string {
	ls := new(common.LogString)
	ls.AddF("%s (ID: %d)\n", a.Name, a.ID)
	for k, v := range a.Providers {
		ls.AddF("[%s]\n%s\n", k, v)
	}
	return ls.Box(85)
}
예제 #2
0
// Displays the contents of the Spec_Type custom type.
func (c NServices) String() string {
	ls := new(common.LogString)
	ls.AddS("Services Response\n")
	for _, s := range c {
		ls.AddF("%s\n", s)
	}
	return ls.Box(80)
}
예제 #3
0
func (p Provider) String() string {
	ls := new(common.LogString)
	ls.AddF("%s (ID: %d)\n", p.Name, p.ID)
	ls.AddF("InterfaceType: %s  URL: %s  ver: %s  Key: %s\n", p.InterfaceType, p.APIVersion, p.URL, p.Key)
	ls.AddS("---SERVICES:\n")
	for _, v := range p.Services {
		ls.AddF("   %s\n", v)
	}
	return ls.Box(80)
}
예제 #4
0
// String returns the represeentation of the RouteData custom type.
func (rd RouteData) String() string {
	ls := new(common.LogString)
	ls.AddS("RouteData\n")
	ls.AddF("Loaded: %t\n", rd.Loaded)
	ls.AddS("INDEX: Area\n")
	for k, v := range rd.areaID {
		ls.AddF("   %-4d  %s\n", k, v.Name)
	}
	ls.AddS("INDEX: Provider\n")
	for k, v := range rd.providerID {
		ls.AddF("   %-4d  %-40s %s\n", k, v.Name, v.URL)
	}
	ls.AddS("INDEX: Service\n")
	for k, v := range rd.serviceID {
		ls.AddF("   %-4d (%t)  %s\n", k, k == v.ID, v.Name)
	}
	ls.AddS("INDEX: City Services\n")
	for k, v := range rd.cityServices {
		ls.AddF("   [[%s]]\n", k)
		for _, sv := range v {
			ls.AddF("      %s\n", sv)
		}
	}
	ls.AddS("INDEX: Provider Service\n")
	for k, v := range rd.providerService {
		ls.AddF("   %-4d %-50.50s  %-40s\n", rd.serviceID[k].ID, rd.serviceID[k].Name, v.Name)
	}
	ls.AddS("Categories\n")
	for i, v := range rd.Categories {
		ls.AddF("   %2d  %s\n", i, v)
	}
	ls.AddS("---AREAS:\n")
	for k, v := range rd.Areas {
		ls.AddF("[%s]\n%s\n", k, v)
	}
	return ls.Box(90)
}
예제 #5
0
// Displays the contents of the Spec_Type custom type.
func (c NServiceRequest) String() string {
	ls := new(common.LogString)
	ls.AddS("Services Request\n")
	ls.AddF("Location - city: %v\n", c.City)
	return ls.Box(80)
}