Documentation ¶
Index ¶
- func MidAdpID(mid string) (string, error)
- func MidAreaID(mid string) (string, error)
- func MidID(mid string) (int, error)
- func MidProviderID(mid string) (int, error)
- func RIDFromString(rids string) (ReportID, NRoute, error)
- func RidAdpID(rid string) (string, error)
- func RidAreaID(rid string) (string, error)
- func RidID(rid string) (int, error)
- func RidProviderID(rid string) (int, error)
- func SplitMID(mid string) (string, string, int, int, error)
- func SplitRID(rid string) (string, string, int, int, error)
- func SplitRMID(mid string) (string, string, int, int, error)
- type NCreateRequest
- type NCreateResponse
- type NID
- type NRequestCommon
- func (r NRequestCommon) GetID() (int64, int64)
- func (r NRequestCommon) GetIDS() string
- func (r NRequestCommon) GetRoute() NRoute
- func (r NRequestCommon) GetType() NRequestType
- func (r NRequestCommon) GetTypeS() string
- func (r *NRequestCommon) SetID(rqstID, rpcID int64)
- func (r *NRequestCommon) SetRoute(route NRoute)
- func (r NRequestCommon) String() string
- type NRequestType
- type NRequester
- type NResponseCommon
- func (r NResponseCommon) GetID() (int64, int64)
- func (r NResponseCommon) GetIDS() string
- func (r NResponseCommon) GetRoute() NRoute
- func (r NResponseCommon) GetType() NResponseType
- func (r NResponseCommon) GetTypeS() string
- func (r *NResponseCommon) SetID(rqstID, rpcID int64)
- func (r *NResponseCommon) SetIDF(f func() (int64, int64))
- func (r *NResponseCommon) SetRoute(route NRoute)
- func (r NResponseCommon) String() string
- type NResponseType
- type NResponser
- type NRoute
- type NRouteType
- type NRouter
- type NRoutes
- type NSearchRequestDID
- type NSearchRequestLL
- type NSearchRequestRID
- type NSearchResponse
- type NSearchResponseReport
- type NService
- type NServiceRequest
- type NServices
- type NServicesResponse
- type Payload
- type PayloadType
- type Payloader
- type ReportID
- type ServiceID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MidProviderID ¶
MidProviderID breaks down an MID, and returns the ProviderID.
func RIDFromString ¶
RIDFromString converts a reportID string to a new ReportID struct.
func RidProviderID ¶
RidProviderID breaks down an RID, and returns the ProviderID.
Types ¶
type NCreateRequest ¶
type NCreateRequest struct { NRequestCommon MID ServiceID ServiceName string DeviceType string DeviceModel string DeviceID string Latitude float64 Longitude float64 FullAddress string Address string Area string State string Zip string FirstName string LastName string Email string Phone string IsAnonymous bool Description string MediaURL string }
NCreateRequest is used to create a new Report. It is the "native" format of the data, and is used by the Engine and all backend Adapters.
func (NCreateRequest) GetRoutes ¶
func (r NCreateRequest) GetRoutes() NRoutes
GetRoutes returns the routing data.
func (NCreateRequest) String ¶
func (r NCreateRequest) String() string
Displays the NCreateRequest custom type.
type NCreateResponse ¶
type NCreateResponse struct { NResponseCommon `json:"-"` Message string `json:"Message" xml:"Message"` RID ReportID `json:"ReportId" xml:"ReportId"` // ID string `json:"ReportId" xml:"ReportId"` AccountID string `json:"AuthorId" xml:"AuthorId"` }
NCreateResponse is the response to creating or updating a report.
func (NCreateResponse) String ¶
func (r NCreateResponse) String() string
Displays the NCreateResponse custom type.
type NRequestCommon ¶
type NRequestCommon struct { ID NID Route NRoute Rtype NRequestType NRouter NRequester }
NRequestCommon represents properties common to all requests.
func (NRequestCommon) GetID ¶
func (r NRequestCommon) GetID() (int64, int64)
GetID returns the Request ID
func (NRequestCommon) GetIDS ¶
func (r NRequestCommon) GetIDS() string
GetIDS returns the Request ID as a string
func (NRequestCommon) GetRoute ¶
func (r NRequestCommon) GetRoute() NRoute
GetRoute returns NRequestCommon.Route
func (NRequestCommon) GetType ¶
func (r NRequestCommon) GetType() NRequestType
GetType returns the Request Type as a string.
func (NRequestCommon) GetTypeS ¶
func (r NRequestCommon) GetTypeS() string
GetTypeS returns the Request Type as a string.
func (*NRequestCommon) SetID ¶
func (r *NRequestCommon) SetID(rqstID, rpcID int64)
SetID sets the Request ID
func (*NRequestCommon) SetRoute ¶
func (r *NRequestCommon) SetRoute(route NRoute)
SetRoute sets the route in NRequestCommon.
func (NRequestCommon) String ¶
func (r NRequestCommon) String() string
Displays the NRequestCommon custom type.
type NRequestType ¶
type NRequestType int
NRequestType enumerates the valid request types.
const ( NRTUnknown NRequestType = iota NRTServicesAll NRTServicesArea NRTCreate NRTSearchLL NRTSearchDID NRTSearchRID )
NRT* are constants enumerating the valid request types.
func (NRequestType) String ¶
func (i NRequestType) String() string
type NRequester ¶
type NRequester interface { GetID() (int64, int64) GetIDS() string SetID(int64, int64) GetRoute() NRoute SetRoute(route NRoute) RouteType() NRouteType GetType() NRequestType GetTypeS() string }
NRequester defines the behavior of a Request Package.
type NResponseCommon ¶
type NResponseCommon struct { ID NID Route NRoute Rtype NResponseType NResponser }
NResponseCommon represents properties common to all requests.
func (NResponseCommon) GetID ¶
func (r NResponseCommon) GetID() (int64, int64)
GetID returns the Request ID
func (NResponseCommon) GetIDS ¶
func (r NResponseCommon) GetIDS() string
GetIDS returns the Request ID as a string
func (NResponseCommon) GetRoute ¶
func (r NResponseCommon) GetRoute() NRoute
GetRoute returns NResponseCommon.Route
func (NResponseCommon) GetType ¶
func (r NResponseCommon) GetType() NResponseType
GetType returns the Response Type as a string.
func (NResponseCommon) GetTypeS ¶
func (r NResponseCommon) GetTypeS() string
GetTypeS returns the Response Type as a string.
func (*NResponseCommon) SetID ¶
func (r *NResponseCommon) SetID(rqstID, rpcID int64)
SetID sets the Request ID
func (*NResponseCommon) SetIDF ¶
func (r *NResponseCommon) SetIDF(f func() (int64, int64))
SetIDF sets the Request ID using the specified function.
func (*NResponseCommon) SetRoute ¶
func (r *NResponseCommon) SetRoute(route NRoute)
SetRoute sets the route in NResponseCommon.
func (NResponseCommon) String ¶
func (r NResponseCommon) String() string
Displays the NResponseCommon custom type.
type NResponseType ¶
type NResponseType int
NResponseType enumerates the valid request types.
const ( NRspTUnknown NResponseType = iota NRspTServices NRspTServicesArea NRspTCreate NRspTSearchLL NRspTSearchDID NRspTSearchRID )
NRspT* are constants enumerating the valid request types.
func (NResponseType) String ¶
func (i NResponseType) String() string
type NResponser ¶
type NResponser interface { GetID() (int64, int64) GetIDS() string SetID(int64, int64) GetType() NResponseType GetTypeS() string GetRoute() NRoute SetRoute(route NRoute) }
NResponser defines the behavior of a Response Package.
type NRoute ¶
NRoute represents the data needed to route requests to Adapters.
func NRouteFromString ¶
NRouteFromString converts a reportID string to a new NRoute struct.
func (NRoute) RouteType ¶
func (r NRoute) RouteType() NRouteType
RouteType returns the validity and type of the NRoute.
type NRouteType ¶
type NRouteType int
NRouteType enumerates the valid route types.
const ( NRtTypEmpty NRouteType = iota NRtTypInvalid NRtTypFull NRtTypArea NRtTypAllAreas NRtTypAllAdapters )
NRT* are constants enumerating the valid request types.
func (NRouteType) String ¶
func (r NRouteType) String() string
type NRouter ¶
type NRouter interface {
GetRoutes() NRoutes
}
NRouter is the interface to retrieve the routing data (AdpID, AreaID) from any N*Request.
type NSearchRequestDID ¶
type NSearchRequestDID struct { NRequestCommon DeviceType string DeviceID string MaxResults int RouteList NRoutes AreaID string }
NSearchRequestDID represents the Normal struct for a request to search for all Reports authored by the specified Device ID.
func (NSearchRequestDID) GetRoutes ¶
func (r NSearchRequestDID) GetRoutes() NRoutes
GetRoutes returns the routing data.
func (NSearchRequestDID) String ¶
func (r NSearchRequestDID) String() string
Displays the NSearchRequestDID custom type.
type NSearchRequestLL ¶
type NSearchRequestLL struct { NRequestCommon Latitude float64 Longitude float64 Radius int // in meters AreaID string MaxResults int }
NSearchRequestLL represents the Normal struct for a location based search request.
func (NSearchRequestLL) GetRoutes ¶
func (r NSearchRequestLL) GetRoutes() NRoutes
GetRoutes returns the routing data.
func (NSearchRequestLL) String ¶
func (r NSearchRequestLL) String() string
Displays the NSearchRequestLL custom type.
type NSearchRequestRID ¶
type NSearchRequestRID struct { NRequestCommon RID ReportID RouteList NRoutes AreaID string }
NSearchRequestRID represents the Normal struct for a request to find a single, specific Report.
func (NSearchRequestRID) GetRoutes ¶
func (r NSearchRequestRID) GetRoutes() NRoutes
GetRoutes returns the routing data.
func (NSearchRequestRID) String ¶
func (r NSearchRequestRID) String() string
Displays the NSearchRequestRID custom type.
type NSearchResponse ¶
type NSearchResponse struct { NResponseCommon `json:"-"` Message string ReportCount int ResponseTime string Reports []NSearchResponseReport }
NSearchResponse contains the search results.
func (NSearchResponse) String ¶
func (r NSearchResponse) String() string
Displays the NSearchResponse custom type.
type NSearchResponseReport ¶
type NSearchResponseReport struct { RID ReportID `xml:"ID" json:"ID"` DateCreated string DateUpdated string DeviceType string DeviceModel string DeviceID string RequestType string RequestTypeID string MediaURL string City string State string ZipCode string Latitude string Longitude string Directionality string Description string AuthorNameFirst string AuthorNameLast string AuthorEmail string AuthorTelephone string AuthorIsAnonymous string URLDetail string URLShortened string Votes string StatusType string TicketSLA string }
NSearchResponseReport represents a report.
func (*NSearchResponseReport) FullAddress ¶
func (r *NSearchResponseReport) FullAddress() string
FullAddress returns the standard formatted full address.
func (NSearchResponseReport) String ¶
func (r NSearchResponseReport) String() string
Displays the the NSearchResponseReport custom type.
type NService ¶
type NService struct { ServiceID Name string `json:"name"` Description string `json:"description"` Metadata bool `json:"metadata"` ResponseType string `json:"responseType"` ServiceNotice string `json:"service_notice"` Keywords []string `json:"keywords"` Group string `json:"group"` }
NService represents a Service. The ID is a combination of the BackEnd Type (AdpID), the AreaID (i.e. the Area id), ProviderID (in case the provider has multiple interfaces), and the Service ID.
func (*NService) UnmarshalJSON ¶
UnmarshalJSON implements the conversion from the JSON "ID" to the ServiceID struct.
type NServiceRequest ¶
type NServiceRequest struct { NRequestCommon Area string }
NServiceRequest is used to get list of services available to the user.
func (NServiceRequest) GetRoutes ¶
func (r NServiceRequest) GetRoutes() NRoutes
GetRoutes returns the routing data.
func (NServiceRequest) String ¶
func (r NServiceRequest) String() string
Displays the NServiceRequest custom type.
type NServicesResponse ¶
type NServicesResponse struct { NResponseCommon AdpID string Message string Services NServices }
NServicesResponse is the returned struct for a Services request.
func (NServicesResponse) String ¶
func (r NServicesResponse) String() string
Displays the NServicesResponse custom type.
type Payload ¶
type Payload struct {
// contains filtered or unexported fields
}
Payload represents the payload for a call to a Provider.
func NewPayloadByte ¶
NewPayloadByte returns a new Payload struct for the specified body of type string.
func NewPayloadString ¶
NewPayloadString returns a new Payload struct for the specified body of type string.
func (Payload) Get ¶
func (r Payload) Get() (ptype PayloadType, contents interface{})
Get returns the type and contents of a Payload.
type PayloadType ¶
type PayloadType int
PayloadType enumerates the valid payload types.
const ( PTUnknown PayloadType = iota PTJSON PTXML PTByte PTString )
NRT* are constants enumerating the valid request types.
type Payloader ¶
type Payloader interface {
Get() (ptype PayloadType, contents interface{})
}
Payloader is an interface to a Payload object to retrieve the Payload contents.
type ReportID ¶
ReportID adds routing information to a ReportID returned by a call to a Service Provider.
func NewRID ¶
NewRID creates a ReportID by concatenating a Route (NRoute string) with a message response ID.