data

package
v0.0.0-...-d5107d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(st BaseReport, comments bool) (int64, int64, error)

func DisplayCommentData

func DisplayCommentData() string

func DisplayReports

func DisplayReports() string

func Distance

func Distance(lat1, lon1, lat2, lon2 float64) float64

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 Init

func Init(fileName string) error

func LastCommentID

func LastCommentID() int64

func LastID

func LastID() int64

func NewComment

func NewComment(rid int64, dc CustomTime, cmt string) error

func UpdateSLA

func UpdateSLA(id int64, sla string) error

func Vote

func Vote(id int64) 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

func FindReportComments(id int64) ([]*Comment, error)

func (Comment) String

func (c Comment) String() string

type Comments

type Comments struct {
	Loaded bool

	All []*Comment `json:"comments" xml:"comments"`

	sync.Mutex
	// contains filtered or unexported fields
}

func (Comments) String

func (c Comments) String() string

type CustomTime

type CustomTime struct {
	time.Time
}

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

func FindAddress(addr string, radius float64, limit int64, comments bool) ([]*Report, error)

func FindDeviceID

func FindDeviceID(id string, comments bool) ([]*Report, error)

func FindID

func FindID(id int64, comments bool) ([]*Report, error)

func FindLL

func FindLL(lat, lng, radius float64, limit int64, comments bool) ([]*Report, error)

func FindZipCode

func FindZipCode(zip string, comments bool) ([]*Report, error)

func GetID

func GetID(id int64, comments bool) (*Report, error)

func (Report) String

func (r Report) String() string

Displays the contents of the Spec_Type custom type.

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) Add

func (rl *ReportList) Add(r *Report, comments bool) error

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) Add

func (rl *ReportListD) Add(r *Report, d float64, comments bool) error

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)

type Reports

type Reports struct {
	Loaded bool

	Reports ReportList `json:"reports" xml:"reports"`

	sync.Mutex
	// contains filtered or unexported fields
}

------------------------------- Data_Type -------------------------------

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL