Beispiel #1
0
// String displays the contents of the CreateReqBase type.
func (c CreateReq) String() string {
	ls := new(common.LogString)
	ls.AddS("Report - CreateReq\n")
	ls.AddF("Backend: %s\n", c.bkend)
	ls.AddS(c.CreateReqBase.String())
	return ls.Box(90)
}
Beispiel #2
0
// Displays the contents of the Spec_Type custom type.
func (c ServicesReq) String() string {
	ls := new(common.LogString)
	ls.AddS("Services\n")
	ls.AddF("JID: %v\n", c.JID)
	ls.AddF("Location - lat: %v  lon: %v  city: %v\n", c.LatitudeV, c.LongitudeV, c.City)
	return ls.Box(80)
}
Beispiel #3
0
// Displays the contents of the Spec_Type custom type.
func (c NCreateResponse) String() string {
	ls := new(common.LogString)
	ls.AddS("Report - Resp\n")
	ls.AddF("Message: %s\n", c.Message)
	ls.AddF("ID: %v  AuthorID: %v\n", c.ID, c.AuthorID)
	return ls.Box(80)
}
Beispiel #4
0
// String returns a formatted representation of Adapter.
func (a Area) String() string {
	ls := new(common.LogString)
	ls.AddF("%s\n", a.ID)
	ls.AddF("Name: %s\n", a.Name)
	ls.AddF("Aliases: \"%s\"\n", strings.Join(a.Aliases, "\", \""))
	return ls.Box(80)
}
Beispiel #5
0
// Displays the contents of the Spec_Type custom type.
func (u ICreateReqResp) String() string {
	ls := new(common.LogString)
	ls.AddS("ICreateReqResp\n")
	ls.AddF("Message: %v\n", u.Message)
	ls.AddF("ID: %v  AuthorID: %v\n", u.ID, u.AuthorID)
	return ls.Box(80)
}
Beispiel #6
0
// Displays the contents of the Spec_Type custom type.
func (r CSSearchResp) String() string {
	ls := new(common.LogString)
	ls.AddS("CSSearchResp\n")
	ls.AddF("Count: %v RspTime: %v Message: %v\n", r.Reports.ReportCount, r.ResponseTime, r.Message)
	for _, x := range r.Reports.Reports {
		ls.AddS(x.String())
	}
	return ls.Box(80)
}
Beispiel #7
0
// Displays the contents of the Spec_Type custom type.
func (r ServicesResp) String() string {
	ls := new(common.LogString)
	ls.AddS("Services Response\n")
	ls.AddF("Message: %v\n", r.Message)
	for k, v := range r.Services {
		ls.AddF("%-18s %-30s [%s]\n", k, v.Name, strings.Join(v.Categories, ", "))
	}

	return ls.Box(80)
}
// Displays the contents of the Spec_Type custom type.
func (sd ServicesData) String() string {
	ls := new(common.LogString)
	ls.AddS("ServicesData\n")
	for k, v := range sd.list {
		ls.AddF("<<<<<City: %s >>>>>\ns", k, v)
	}
	return ls.Box(90)
}
Beispiel #9
0
// Displays the contents of the Spec_Type custom type.
func (c NServices) String() string {
	ls := new(common.LogString)
	ls.AddS("NServices\n")
	for _, s := range c {
		ls.AddF("%s\n", s)
	}
	return ls.Box(80)
}
Beispiel #10
0
// Displays the contents of the Spec_Type custom type.
func (sd cache) String() string {
	ls := new(common.LogString)
	ls.AddF("cache [%d]\n", sd.activeList)
	for k, v := range sd.list[sd.activeList] {
		ls.AddF("<<<<<Area: %s >>>>>%s", k, v)
	}
	return ls.Box(90)
}
Beispiel #11
0
// String displays the contents of the CreateReqBase type.
func (c CreateReqBase) String() string {
	ls := new(common.LogString)
	ls.AddS("Report - CreateReqBase\n")
	ls.AddF("Device - type %s  model: %s  ID: %s\n", c.DeviceType, c.DeviceModel, c.DeviceID)
	ls.AddF("Request - id: %q  name: %q\n", c.MID.MID(), c.ServiceName)
	ls.AddF("Location - lat: %v(%q)  lon: %v(%q)\n", c.LatitudeV, c.Latitude, c.LongitudeV, c.Longitude)
	ls.AddF("          %s, %s   %s\n", c.City, c.State, c.Zip)
	if math.Abs(c.LatitudeV) > 1 {
		ls.AddF("Location - lat: %v(%q)  lon: %v(%q)\n", c.LatitudeV, c.Latitude, c.LongitudeV, c.Longitude)
	}
	if len(c.City) > 1 {
		ls.AddF("          %s, %s   %s\n", c.City, c.State, c.Zip)
	}
	ls.AddF("Description: %q\n", c.Description)
	ls.AddF("Author(anon: %t) %s %s  Email: %s  Tel: %s\n", c.isAnonymous, c.FirstName, c.LastName, c.Email, c.Phone)
	return ls.Box(80)
}
Beispiel #12
0
// Displays the contents of the Spec_Type custom type.
func (r ICreateReq) String() string {
	ls := new(common.LogString)
	ls.AddS("City Sourced - Create\n")
	ls.AddF("API - auth: %q  RequestType: %q  Version: %q\n", r.APIAuthKey, r.APIRequestType, r.APIRequestVersion)
	ls.AddF("Device - type %s  model: %s  ID: %s\n", r.DeviceType, r.DeviceModel, r.DeviceID)
	ls.AddF("Request - type: %q  id: %d\n", r.RequestType, r.RequestTypeID)
	ls.AddF("Location - lat: %v  lon: %v\n", r.Latitude, r.Longitude)
	ls.AddF("Description: %q\n", r.Description)
	ls.AddF("Author(anon: %t) %s %s  Email: %s  Tel: %s\n", r.AuthorIsAnonymous, r.AuthorNameFirst, r.AuthorNameLast, r.AuthorEmail, r.AuthorTelephone)
	return ls.Box(80)
}
Beispiel #13
0
func (r RPCCall) String() string {
	ls := new(common.LogString)
	ls.AddS("RPC Call\n")
	ls.AddF("Service: %s\n", r.service)
	ls.AddF("Request: (%p)  results chan: (%p)\n", &r.request, r.results)
	ls.AddF("%s\n", r.request)
	ls2 := new(common.LogString)
	ls2.AddS("Adapters\n")
	ls2.AddF("         Name/Type/Address                 Sent  Repl     Response\n")
	for k, v := range r.adpList {
		ls2.AddF("  %4s: %s\n", k, v)
	}
	ls.AddF("%s", ls2.Box(80))
	ls.AddF("Processes: %d\n", r.processes)
	ls.AddF("Process interface: (%p)\n", r.process)
	if len(r.errs) == 0 {
		ls.AddS("Error: NONE!\n")
	} else {
		ls.AddS("Errors\n")
		for _, e := range r.errs {
			ls.AddF("\t%s\n", e.Error())
		}
	}
	return ls.Box(90)
}
Beispiel #14
0
// Displays the contents of the Spec_Type custom type.
func (ncr NCreateRequest) String() string {
	ls := new(common.LogString)
	ls.AddS("Report - NCreateReq\n")
	ls.AddF("Device - type %s  model: %s  ID: %s\n", ncr.DeviceType, ncr.DeviceModel, ncr.DeviceID)
	ls.AddF("Request - %s:  %s\n", ncr.MID.MID(), ncr.Type)
	ls.AddF("Location - lat: %v lon: %v\n", ncr.Latitude, ncr.Longitude)
	ls.AddF("          %s, %s   %s\n", ncr.Area, ncr.State, ncr.Zip)
	// if math.Abs(ncr.LatitudeV) > 1 {
	// 	ls.AddF("Location - lat: %v(%q)  lon: %v(%q)\n", ncr.LatitudeV, ncr.Latitude, ncr.LongitudeV, ncr.Longitude)
	// }
	// if len(ncr.Area) > 1 {
	// 	ls.AddF("          %s, %s   %s\n", ncr.Area, ncr.State, ncr.Zip)
	// }
	ls.AddF("Description: %q\n", ncr.Description)
	ls.AddF("Author(anon: %t) %s %s  Email: %s  Tel: %s\n", ncr.IsAnonymous, ncr.FirstName, ncr.LastName, ncr.Email, ncr.Phone)
	return ls.Box(80)
}
Beispiel #15
0
// Displays the contents of the Spec_Type custom type.
func (c NServicesResponse) String() string {
	ls := new(common.LogString)
	ls.AddS("Services Response\n")
	ls.AddF("Message: %q%s", c.Message, c.Services)
	return ls.Box(90)
}
Beispiel #16
0
// Displays the contents of the Spec_Type custom type.
func (n NServiceRequest) String() string {
	ls := new(common.LogString)
	ls.AddS("Services Request\n")
	ls.AddF("Location - area: %v\n", n.Area)
	return ls.Box(80)
}
func (r rpcCalls) String() string {
	ls := new(common.LogString)
	ls.AddS("RPC Call\n")
	ls.AddF("Service: %s\n", r.service)
	ls.AddF("Request: %p  done: %p\n", r.request, r.result)
	ls.AddF("Request: %s\n", spew.Sdump(r.request))
	ls.AddF("  Name Sent  Repl Type  Address \n")
	for _, v := range r.listIF {
		ls.AddF("%s\n", v)
	}
	ls.AddF("Processes: %d\n%s\n", r.processes, r.listIF)
	ls.AddF("Process interface: %p\n", r.process)
	if len(r.errs) == 0 {
		ls.AddS("NO ERRORS!\n")
	} else {
		ls.AddS("Errors\n")
		for _, e := range r.errs {
			ls.AddF("\t%s\n", e.Error())
		}
	}
	return ls.Box(80)
}
Beispiel #18
0
// Displays the contents of the Spec_Type custom type.
func (c SearchReq) String() string {
	ls := new(common.LogString)
	ls.AddS("Search\n")
	ls.AddF("Bkend: %s\n", c.bkend)
	ls.AddF("Device ID: %s\n", c.DeviceID)
	ls.AddF("Location\n")
	if math.Abs(c.LatitudeV) > 1 {
		ls.AddF("   lat: %v  lon: %v\n", c.LatitudeV, c.LongitudeV)
	}
	if len(c.City) > 1 {
		ls.AddF("   \n", c.Address)
		ls.AddF("   %s, %s   %s\n", c.City, c.State, c.Zip)
	}
	return ls.Box(80)
}
Beispiel #19
0
// Displays the contents of the Spec_Type custom type.
func (r CSSearchDIDReq) String() string {
	ls := new(common.LogString)
	ls.AddS("City Sourced - Search\n")
	ls.AddF("Device - type %s  ID: %s\n", r.DeviceType, r.DeviceID)
	ls.AddF("MaxResults: %v  IncludeDetails: %v\n", r.MaxResults, r.IncludeDetails)
	ls.AddF("Date Range - start: %v  end: %v\n", r.DateRangeStart, r.DateRangeEnd)
	return ls.Box(80)
}
Beispiel #20
0
// Displays the contents of the Spec_Type custom type.
func (r CSSearchLLReq) String() string {
	ls := new(common.LogString)
	ls.AddS("City Sourced - Search LL\n")
	ls.AddF("Location - lat: %v  lon: %v\n", r.Latitude, r.Longitude)
	ls.AddF("MaxResults: %v  IncludeDetails: %v\n", r.MaxResults, r.IncludeDetails)
	ls.AddF("Date Range - start: %v  end: %v\n", r.DateRangeStart, r.DateRangeEnd)
	return ls.Box(80)
}
Beispiel #21
0
// String returns a formatted representation of Adapters.
func (adps Adapters) String() string {
	ls := new(common.LogString)
	ls.AddS("Adapters\n")
	for _, v := range adps.Adapters {
		ls.AddS(v.String())
	}
	ls.AddS("\n-------Areas---------------\n")
	for _, v := range adps.Areas {
		// ls.AddS("   %5s %-7s  %-25s  [%s]\n", k, fmt.Sprintf("(%s)", v.ID), v.Name, fmt.Sprintf("\"%s\"", strings.Join(v.Aliases, "\", \"")))
		ls.AddF("%s\n", v)
	}
	ls.AddS("\n-------AreaAlias-----------\n")
	for k, v := range adps.areaAlias {
		ls.AddF("   %-20s  %s\n", k, v.ID)
	}
	ls.AddS("\n-------AreaAdapters--------\n")
	for k, v := range adps.areaAdapters {
		var s []string
		for _, a := range v {
			s = append(s, a.ID)
		}
		ls.AddF("   %-5s  %s\n", k, strings.Join(s, ", "))
	}
	return ls.Box(90)
}
Beispiel #22
0
// Displays the contents of the Spec_Type custom type.
func (r CSSearchZipReq) String() string {
	ls := new(common.LogString)
	ls.AddS("City Sourced - Search\n")
	ls.AddF("Location - zip: %v\n", r.Zip)
	ls.AddF("MaxResults: %v  IncludeDetails: %v\n", r.MaxResults, r.IncludeDetails)
	ls.AddF("Date Range - start: %v  end: %v\n", r.DateRangeStart, r.DateRangeEnd)
	return ls.Box(80)
}