Documentation ¶
Overview ¶
Copyright (C) 2015 Scott Devoid Copyright (C) 2015 Salsita Software
Copyright (c) 2014 Salsita Software Copyright (C) 2015 Scott Devoid Use of this source code is governed by the MIT License. The license can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- type AccountingType
- type Client
- type Comment
- type Date
- type Day
- type ErrAPI
- type ErrFieldNotSet
- type Error
- type Label
- type Me
- type MeService
- type Person
- type Project
- type ProjectService
- type Story
- type StoryCursor
- type StoryRequest
- type StoryService
- func (service *StoryService) AddComment(projectId int, storyId int, comment *Comment) (*Comment, *http.Response, error)
- func (service *StoryService) AddTask(projectId, storyId int, task *Task) (*http.Response, error)
- func (service *StoryService) Get(projectId, storyId int) (*Story, *http.Response, error)
- func (service *StoryService) Iterate(projectId int, filter string) (c *StoryCursor, err error)
- func (service *StoryService) List(projectId int, filter string) ([]*Story, error)
- func (service *StoryService) ListOwners(projectId, storyId int) ([]*Person, *http.Response, error)
- func (service *StoryService) ListTasks(projectId, storyId int) ([]*Task, *http.Response, error)
- func (service *StoryService) Update(projectId, storyId int, story *StoryRequest) (*Story, *http.Response, error)
- type Task
- type TimeZone
Constants ¶
const ( ProjectTypePublic = "public" ProjectTypePrivate = "private" ProjectTypeDemo = "demo" )
const ( StoryTypeFeature = "feature" StoryTypeBug = "bug" StoryTypeChore = "chore" StoryTypeRelease = "release" )
const ( StoryStateUnscheduled = "unscheduled" StoryStatePlanned = "planned" StoryStateUnstarted = "unstarted" StoryStateStarted = "started" StoryStateFinished = "finished" StoryStateDelivered = "delivered" StoryStateAccepted = "accepted" StoryStateRejected = "rejected" )
const (
LibraryVersion = "0.0.1"
)
const PageLimit = 10
Number of items to fetch at once when getting paginated response.
Variables ¶
var ErrNoTrailingSlash = errors.New("trailing slash missing")
Functions ¶
This section is empty.
Types ¶
type AccountingType ¶
type AccountingType string
const ( AccountingTypeUnbillable AccountingType = "unbillable" AccountingTypeBillable AccountingType = "billable" AccountingTypeOverhead AccountingType = "overhead" )
type Client ¶
type Client struct { // Me service Me *MeService // Project service Projects *ProjectService // Story service Stories *StoryService // contains filtered or unexported fields }
func (*Client) NewRequest ¶
func (*Client) SetBaseURL ¶
func (*Client) SetUserAgent ¶
type Comment ¶
type Comment struct { Id int `json:"id,omitempty"` StoryId int `json:"story_id,omitempty"` EpicId int `json:"epic_id,omitempty"` PersonId int `json:"person_id,omitempty"` Text string `json:"text,omitempty"` FileAttachmentIds []int `json:"file_attachment_ids,omitempty"` GoogleAttachmentIds []int `json:"google_attachment_ids,omitempty"` CommitType string `json:"commit_type,omitempty"` CommitIdentifier string `json:"commit_identifier,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type ErrFieldNotSet ¶
type ErrFieldNotSet struct {
// contains filtered or unexported fields
}
func (*ErrFieldNotSet) Error ¶
func (err *ErrFieldNotSet) Error() string
type Error ¶
type Error struct { Code string `json:"code"` Error string `json:"error"` Requirement string `json:"requirement"` GeneralProblem string `json:"general_problem"` PossibleFix string `json:"possible_fix"` ValidationErrors []struct { Field string `json:"field"` Problem string `json:"problem"` } `json:"validation_errors"` }
type Me ¶
type Me struct { Id int `json:"id"` Name string `json:"name"` Initials string `json:"initials"` Username string `json:"username"` TimeZone *TimeZone `json:"time_zone"` ApiToken string `json:"api_token"` HasGoogleIdentity bool `json:"has_google_identity"` ProjectIds *[]int `json:"project_ids"` WorkspaceIds *[]int `json:"workspace_ids"` Email string `json:"email"` ReceivedInAppNotifications bool `json:"receives_in_app_notifications"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
type Project ¶
type Project struct { Id int `json:"id"` Name string `json:"name"` Version int `json:"version"` IterationLength int `json:"iteration_length"` WeekStartDay Day `json:"week_start_day"` PointScale string `json:"point_scale"` PointScaleIsCustom bool `json:"point_scale_is_custom"` BugsAndChoresAreEstimatable bool `json:"bugs_and_chores_are_estimatable"` AutomaticPlanning bool `json:"automatic_planning"` EnableTasks bool `json:"enable_tasks"` StartDate *Date `json:"start_date"` TimeZone *TimeZone `json:"time_zone"` VelocityAveragedOver int `json:"velocity_averaged_over"` ShownIterationsStartTime *time.Time `json:"shown_iterations_start_time"` StartTime *time.Time `json:"start_time"` NumberOfDoneIterationsToShow int `json:"number_of_done_iterations_to_show"` HasGoogleDomain bool `json:"has_google_domain"` Description string `json:"description"` ProfileContent string `json:"profile_content"` EnableIncomingEmails bool `json:"enable_incoming_emails"` InitialVelocity int `json:"initial_velocity"` ProjectType string `json:"project_type"` Public bool `json:"public"` AtomEnabled bool `json:"atom_enabled"` CurrentIterationNumber int `json:"current_iteration_number"` CurrentVelocity int `json:"current_velocity"` CurrentVolatility float64 `json:"current_volatility"` AccountId int `json:"account_id"` AccountingType AccountingType `json:"accounting_type"` Featured bool `json:"featured"` StoryIds []int `json:"story_ids"` EpicIds []int `json:"epic_ids"` MembershipIds []int `json:"membership_ids"` LabelIds []int `json:"label_ids"` IntegrationIds []int `json:"integration_ids"` IterationOverrideNumbers []int `json:"iteration_override_numbers"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
type ProjectService ¶
type ProjectService struct {
// contains filtered or unexported fields
}
type Story ¶
type Story struct { Id int `json:"id,omitempty"` ProjectId int `json:"project_id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Type string `json:"story_type,omitempty"` State string `json:"current_state,omitempty"` Estimate *float64 `json:"estimate,omitempty"` AcceptedAt *time.Time `json:"accepted_at,omitempty"` Deadline *time.Time `json:"deadline,omitempty"` RequestedById int `json:"requested_by_id,omitempty"` OwnerIds []int `json:"owner_ids,omitempty"` LabelIds []int `json:"label_ids,omitempty"` Labels []*Label `json:"labels,omitempty"` TaskIds []int `json:"task_ids,omitempty"` Tasks []int `json:"tasks,omitempty"` FollowerIds []int `json:"follower_ids,omitempty"` CommentIds []int `json:"comment_ids,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` IntegrationId int `json:"integration_id,omitempty"` ExternalId string `json:"external_id,omitempty"` URL string `json:"url,omitempty"` }
type StoryCursor ¶
type StoryCursor struct {
// contains filtered or unexported fields
}
func (*StoryCursor) Next ¶
func (c *StoryCursor) Next() (s *Story, err error)
Next returns the next story.
In case there are no more stories, io.EOF is returned as an error.
type StoryRequest ¶
type StoryRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Type string `json:"story_type,omitempty"` State string `json:"current_state,omitempty"` Estimate *float64 `json:"estimate,omitempty"` OwnerIds *[]int `json:"owner_ids,omitempty"` LabelIds *[]int `json:"label_ids,omitempty"` Labels *[]*Label `json:"labels,omitempty"` TaskIds *[]int `json:"task_ids,omitempty"` Tasks *[]int `json:"tasks,omitempty"` FollowerIds *[]int `json:"follower_ids,omitempty"` CommentIds *[]int `json:"comment_ids,omitempty"` }
type StoryService ¶
type StoryService struct {
// contains filtered or unexported fields
}
func (*StoryService) AddComment ¶
func (*StoryService) Iterate ¶
func (service *StoryService) Iterate(projectId int, filter string) (c *StoryCursor, err error)
Iterate returns a cursor that can be used to iterate over the stories specified by the filter. More stories are fetched on demand as needed.
func (*StoryService) List ¶
func (service *StoryService) List(projectId int, filter string) ([]*Story, error)
List returns all stories matching the filter in case the filter is specified.
List actually sends 2 HTTP requests - one to get the total number of stories, another to retrieve the stories using the right pagination setup. The reason for this is that the filter might require to fetch all the stories at once to get the right results. Since the response as generated by Pivotal Tracker is not always sorted when using a filter, this approach is required to get the right data. Not sure whether this is a bug or a feature.
func (*StoryService) ListOwners ¶
func (*StoryService) Update ¶
func (service *StoryService) Update(projectId, storyId int, story *StoryRequest) (*Story, *http.Response, error)
type Task ¶
type Task struct { Id int `json:"id,omitempty"` StoryId int `json:"story_id,omitempty"` Description string `json:"description,omitempty"` Position int `json:"position,omitempty"` Complete bool `json:"complete,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }