interval

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package interval implements the fetching of time intervals from the fogbugz api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interval

type Interval struct {
	IntervalID int       `xml:"ixInterval"`
	PersonID   int       `xml:"ixPerson"`
	Bug        int       `xml:"ixBug"`
	Start      time.Time `xml:"dtStart"` // UTC Date
	End        time.Time `xml:"dtEnd"`   // UTC Date
	Deleted    bool      `xml:"fDeleted"`
	Title      string    `xml:"sTitle"`

	// Empty values populated after the xml is unmarshalled
	StartLocal time.Time // Start Date converted to local time
	EndLocal   time.Time // End Date converted to local time
	Duration   float64   // Duration of the hours worked
}

Interval holds the meta data about increment of time spent on a bug.

type Intervals

type Intervals struct {
	XMLName  xml.Name   `xml:"intervals"`
	Interval []Interval `xml:"interval"`

	// Bugs: Distinct iXBug(s) in csv string passed to ListCases.
	Bugs string
}

Intervals contains the list of interval data and list of bugs and the distinct list of bugs passed to ListCases for all of the intervals collected.

func ListIntervals

func ListIntervals(token string, root *url.URL, dtStartUTC string, dtEndUTC string, timezone string) Intervals

ListIntervals accepts start date and end date in UTC and returns a list of cases and converts the UTC dates to Local dates using the timezone, and calculates the duration of each time interval in hours.

type Response

type Response struct {
	XMLName   xml.Name `xml:"response"`
	Intervals Intervals
}

Response contains the array of intervals.

Jump to

Keyboard shortcuts

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