Documentation ¶
Index ¶
- func Append(st BaseReport, comments bool) (int64, int64, error)
- func DisplayCommentData() string
- func DisplayReports() string
- func Distance(lat1, lon1, lat2, lon2 float64) float64
- func Init(fileName string) error
- func LastCommentID() int64
- func LastID() int64
- func NewComment(rid int64, dc CustomTime, cmt string) error
- func UpdateSLA(id int64, sla string) error
- func Vote(id int64) error
- type BaseReport
- type Comment
- type Comments
- type CustomTime
- type Report
- func FindAddress(addr string, radius float64, limit int64, comments bool) ([]*Report, error)
- func FindDeviceID(id string, comments bool) ([]*Report, error)
- func FindID(id int64, comments bool) ([]*Report, error)
- func FindLL(lat, lng, radius float64, limit int64, comments bool) ([]*Report, error)
- func FindZipCode(zip string, comments bool) ([]*Report, error)
- func GetID(id int64, comments bool) (*Report, error)
- type ReportList
- type ReportListD
- type Reports
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayCommentData ¶
func DisplayCommentData() string
func DisplayReports ¶
func DisplayReports() string
func Distance ¶
Distance function returns the distance (in meters) between two points of
a given longitude and latitude relatively accurately (using a spherical approximation of the Earth) through the Haversin Distance Formula for great arc distance on a sphere with accuracy for small distances
point coordinates are supplied in degrees and converted into rad. in the func
distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula
func LastCommentID ¶
func LastCommentID() int64
func NewComment ¶
func NewComment(rid int64, dc CustomTime, cmt string) error
Types ¶
type BaseReport ¶
type BaseReport struct { DateCreated CustomTime `json:"DateCreated" xml:"DateCreated"` DateUpdated CustomTime `json:"DateUpdated" xml:"DateUpdated"` DeviceType string `json:"DeviceType" xml:"DeviceType"` DeviceModel string `json:"DeviceModel" xml:"DeviceModel"` DeviceID string `json:"DeviceId" xml:"DeviceId"` RequestType string `json:"RequestType" xml:"RequestType"` RequestTypeID string `json:"RequestTypeId" xml:"RequestTypeId"` ImageUrl string `json:"ImageUrl" xml:"ImageUrl"` ImageUrlXl string `json:"ImageUrlXl" xml:"ImageUrlXl"` ImageUrlLg string `json:"ImageUrlLg" xml:"ImageUrlLg"` ImageUrlMd string `json:"ImageUrlMd" xml:"ImageUrlMd"` ImageUrlSm string `json:"ImageUrlSm" xml:"ImageUrlSm"` ImageUrlXs string `json:"ImageUrlXs" xml:"ImageUrlXs"` City string `json:"City" xml:"City"` State string `json:"State" xml:"State"` ZipCode string `json:"ZipCode" xml:"ZipCode"` Latitude string `xml:"Latitude" json:"Latitude"` LatitudeV float64 // Longitude string `xml:"Longitude" json:"Longitude"` LongitudeV float64 // Directionality string `json:"Directionality" xml:"Directionality"` Description string `json:"Description" xml:"Description"` AuthorNameFirst string `json:"AuthorNameFirst" xml:"AuthorNameFirst"` AuthorNameLast string `json:"AuthorNameLast" xml:"AuthorNameLast"` AuthorEmail string `json:"AuthorEmail" xml:"AuthorEmail"` AuthorTelephone string `json:"AuthorTelephone" xml:"AuthorTelephone"` AuthorIsAnonymous string `xml:"AuthorIsAnonymous" json:"AuthorIsAnonymous"` AuthorIsAnonymousV bool // UrlDetail string `json:"UrlDetail" xml:"UrlDetail"` UrlShortened string `json:"UrlShortened" xml:"UrlShortened"` Votes string `json:"Votes" xml:"Votes"` VotesV int64 // StatusType string `json:"StatusType" xml:"StatusType"` TicketSLA string `json:"TicketSla" xml:"TicketSla"` }
------------------------------- BaseReport_Type -------------------------------
func (*BaseReport) AuthIsAnon ¶
func (st *BaseReport) AuthIsAnon() bool
func (*BaseReport) CalcDistance ¶
func (r *BaseReport) CalcDistance(rlat, rlon float64) float64
func (BaseReport) String ¶
func (s BaseReport) String() string
Displays the contents of the Spec_Type custom type.
func (*BaseReport) Validate ¶
func (st *BaseReport) Validate() error
type Comment ¶
type Comment struct { XMLName xml.Name `xml:"Comment" json:"Comment"` ID int64 `json:"Id" xml:"Id"` ReportID int64 `json:"ReportID" xml:"ReportID"` DateCreated CustomTime `json:"DateCreated" xml:"DateCreated"` Comment string `json:"Text" xml:"Text"` }
func FindReportComments ¶
type Comments ¶
type CustomTime ¶
func NewCustomTime ¶
func NewCustomTime(in string) CustomTime
func (*CustomTime) IsSet ¶
func (ct *CustomTime) IsSet() bool
func (*CustomTime) MarshalJSON ¶
func (ct *CustomTime) MarshalJSON() ([]byte, error)
func (CustomTime) MarshalText ¶
func (ct CustomTime) MarshalText() (result []byte, err error)
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)
func (*CustomTime) UnmarshalText ¶
func (ct *CustomTime) UnmarshalText(text []byte) error
type Report ¶
type Report struct { XMLName xml.Name `xml:"Report" json:"Report"` ID int64 `json:"Id" xml:"Id"` BaseReport Comments []*Comment `json:"Comments,omitempty" xml:"Comments,omitempty"` }
------------------------------- Report_Type -------------------------------
func FindAddress ¶
type ReportList ¶
type ReportList []*Report
------------------------------- ReportList -------------------------------
func ReportDataTEST ¶
func ReportDataTEST() *ReportList
This is for running "go test" only. It should be commented out after testing.
func (*ReportList) AddBR ¶
func (rl *ReportList) AddBR(id int64, st *BaseReport, comments bool) (*Report, error)
type ReportListD ¶
type ReportListD struct { ReportList // contains filtered or unexported fields }
------------------------------- ReportListD ------------------------------- Has "Distance" capabilities
func (*ReportListD) Len ¶
func (rl *ReportListD) Len() int
func (*ReportListD) Less ¶
func (rl *ReportListD) Less(i, j int) bool
func (*ReportListD) Limit ¶
func (rl *ReportListD) Limit(n int64)
func (*ReportListD) Sort ¶
func (rl *ReportListD) Sort()
func (*ReportListD) Swap ¶
func (rl *ReportListD) Swap(i, j int)