Documentation
¶
Overview ¶
Package tickets provides access to a project's tickets via the Lighthouse API. http://help.lighthouseapp.com/kb/api/tickets.
Index ¶
- Constants
- func Number(numberStr string) (int, error)
- type AlphabeticalTag
- type AlphabeticalTags
- type Attachment
- type AttachmentResponse
- type Attachments
- type AttachmentsResponse
- type BulkEditOptions
- type DiffableAttributes
- type ListOptions
- type Service
- func (s *Service) AddAttachment(t *Ticket, filename string, r io.Reader) error
- func (s *Service) BulkEdit(opts *BulkEditOptions) error
- func (s *Service) Create(t *Ticket) (*Ticket, error)
- func (s *Service) Delete(numberStr string) error
- func (s *Service) DeleteByNumber(number int) error
- func (s *Service) Get(numberStr string) (*Ticket, error)
- func (s *Service) GetAttachment(a *Attachment) (io.ReadCloser, error)
- func (s *Service) GetByNumber(number int) (*Ticket, error)
- func (s *Service) List(opts *ListOptions) (Tickets, error)
- func (s *Service) ListAll(opts *ListOptions) (Tickets, error)
- func (s *Service) New() (*Ticket, error)
- func (s *Service) Update(t *Ticket) error
- type Tag
- type TagResponse
- type Tags
- type TagsResponse
- type Ticket
- type TicketCreate
- type TicketUpdate
- type TicketVersion
- type TicketVersions
- type Tickets
Constants ¶
View Source
const ( DefaultLimit = 30 MaxLimit = 100 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlphabeticalTag ¶
func (*AlphabeticalTag) MarshalJSON ¶
func (at *AlphabeticalTag) MarshalJSON() ([]byte, error)
func (*AlphabeticalTag) UnmarshalJSON ¶
func (at *AlphabeticalTag) UnmarshalJSON(data []byte) error
type AlphabeticalTags ¶
type AlphabeticalTags []*AlphabeticalTag
type Attachment ¶
type Attachment struct { AttachmentFileProcessing bool `json:"attachment_file_processing"` Code string `json:"code"` ContentType string `json:"content_type"` CreatedAt *time.Time `json:"created_at"` Filename string `json:"filename"` Height int `json:"height"` ID int `json:"id"` ProjectID int `json:"project_id"` Size int `json:"size"` UploaderID int `json:"uploader_id"` Width int `json:"width"` URL string `json:"url"` }
type AttachmentResponse ¶
type AttachmentResponse struct {
Attachment *Attachment `json:"attachment"`
}
type Attachments ¶
type Attachments []*Attachment
type AttachmentsResponse ¶
type AttachmentsResponse struct {
Attachments []*AttachmentResponse `json:"attachments"`
}
type BulkEditOptions ¶
type BulkEditOptions struct { // This is any search query that is valid on the tickets // page. You can also reference all tickets with 'all' or a // single ticket with just the ticket's number. See // http://help.lighthouseapp.com/faqs/getting-started/how-do-i-search-for-tickets. Query string // This is a string of commands using the keywords from Query. Command string // MigrationToken is the API token of a user that has access // to the project that a ticket is migrating to. If the // 'project' or 'account' keywords are not used, this is // ignored. Otherwise, MigrationToken must be set. MigrationToken string }
type DiffableAttributes ¶
type ListOptions ¶
type ListOptions struct { // Search query, see // http://help.lighthouseapp.com/faqs/getting-started/how-do-i-search-for-tickets. // Default sort is by last update. Query string // If non-zero, the number of tickets per page to return. // Default is DefaultLimit, max is MaxLimit. Limit int // If non-zero, the page to return Page int }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(s *lighthouse.Service, projectID int) *Service
func (*Service) AddAttachment ¶
func (*Service) BulkEdit ¶
func (s *Service) BulkEdit(opts *BulkEditOptions) error
Undocumented, see https://lighthouse.tenderapp.com/kb/ticket-workflow/how-do-i-update-tickets-with-keywords and http://pastie.org/460585.
func (*Service) DeleteByNumber ¶ added in v0.4.1
func (*Service) GetAttachment ¶
func (s *Service) GetAttachment(a *Attachment) (io.ReadCloser, error)
func (*Service) GetByNumber ¶ added in v0.4.1
type TagResponse ¶
type TagResponse struct {
Tag *Tag `json:"tag"`
}
type TagsResponse ¶
type TagsResponse struct {
Tags []*TagResponse `json:"tags"`
}
type Ticket ¶
type Ticket struct { AssignedUserID int `json:"assigned_user_id"` AttachmentsCount int `json:"attachments_count"` Body string `json:"body"` BodyHTML string `json:"body_html"` Closed bool `json:"closed"` CreatedAt *time.Time `json:"created_at"` CreatorID int `json:"creator_id"` Importance int `json:"importance"` MilestoneDueOn *time.Time `json:"milestone_due_on"` MilestoneID int `json:"milestone_id"` MilestoneOrder int `json:"milestone_order"` Number int `json:"number"` Permalink string `json:"permalink"` ProjectID int `json:"project_id"` RawData []byte `json:"raw_data"` Spam bool `json:"spam"` State string `json:"state,omitempty"` Tag string `json:"tag"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` UserID int `json:"user_id"` Version int `json:"version"` WatchersIDs []int `json:"watchers_ids"` UserName string `json:"user_name"` CreatorName string `json:"creator_name"` AssignedUserName string `json:"assigned_user_name"` URL string `json:"url"` MilestoneTitle string `json:"milestone_title"` Priority int `json:"priority"` ImportanceName string `json:"importance_name"` OriginalBody string `json:"original_body"` LatestBody string `json:"latest_body"` OriginalBodyHTML string `json:"original_body_html"` StateColor string `json:"state_color"` Tags []*TagResponse `json:"tags"` AlphabeticalTags AlphabeticalTags `json:"alphabetical_tags"` Versions TicketVersions `json:"versions"` Attachments []*AttachmentResponse `json:"attachments"` }
type TicketCreate ¶
type TicketCreate struct { Title string `json:"title"` Body string `json:"body"` State string `json:"state,omitempty"` AssignedUserID int `json:"assigned_user_id,omitempty"` MilestoneID int `json:"milestone_id,omitempty"` Tag string `json:"tag"` // See: // http://help.lighthouseapp.com/discussions/api-developers/196-change-ticket-notifications NotifyAll *bool `json:"notify_all,omitempty"` MultipleWatchers []int `json:"multiple_watchers,omitempty"` }
type TicketUpdate ¶
type TicketVersion ¶
type TicketVersion struct { AssignedUserID int `json:"assigned_user_id"` AttachmentsCount int `json:"attachments_count"` Body string `json:"body"` BodyHTML string `json:"body_html"` Closed bool `json:"closed"` CreatedAt *time.Time `json:"created_at"` CreatorID int `json:"creator_id"` DiffableAttributes *DiffableAttributes `json:"diffable_attributes,omitempty"` Importance int `json:"importance"` MilestoneID int `json:"milestone_id"` MilestoneOrder int `json:"milestone_order"` Number int `json:"number"` Permalink string `json:"permalink"` ProjectID int `json:"project_id"` RawData []byte `json:"raw_data"` Spam bool `json:"spam"` State string `json:"state,omitempty"` Tag string `json:"tag"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` UserID int `json:"user_id"` Version int `json:"version"` WatchersIDs []int `json:"watchers_ids"` UserName string `json:"user_name"` CreatorName string `json:"creator_name"` URL string `json:"url"` Priority int `json:"priority"` StateColor string `json:"state_color"` }
type TicketVersions ¶
type TicketVersions []*TicketVersion
Click to show internal directories.
Click to hide internal directories.