Documentation ¶
Index ¶
- Variables
- func NewAuthenticatedJira(service, user string) (ticket.TicketSystem, error)
- func NewJira(service, user string) ticket.TicketSystem
- type ApplicationRoles
- type ApplicationRolesItem
- type Attachment
- type AttachmentAuthor
- type AuthorElement
- type AvatarUrls
- type Backend
- type BackendImplementation
- func (s *BackendImplementation) BasicAuth(username, password string) string
- func (s *BackendImplementation) Call(method, path, username, password string, body interface{}, v interface{}) (*http.Response, error)
- func (s *BackendImplementation) Do(req *http.Request, v interface{}) (*http.Response, error)
- func (s *BackendImplementation) NewRequest(method, path, auth, contentType string, body interface{}) (*http.Request, error)
- type Callback
- type Comment
- type ContentContent
- type Description
- type DescriptionContent
- type Groups
- type GroupsItem
- type Insight
- type InwardIssueFields
- type IssueBean
- type IssueBeanFields
- type IssueResource
- type Issuelink
- type Issuetype
- type JiraClient
- type JiraCredentials
- type MyselfResource
- type Project
- type ProjectCategory
- type Status
- type Timetracking
- type Type
- type User
- type Visibility
- type WardIssue
- type Watcher
- type Worklog
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("received 404")
Functions ¶
func NewAuthenticatedJira ¶
func NewAuthenticatedJira(service, user string) (ticket.TicketSystem, error)
func NewJira ¶
func NewJira(service, user string) ticket.TicketSystem
Types ¶
type ApplicationRoles ¶
type ApplicationRoles struct { Size int64 `json:"size"` Items []ApplicationRolesItem `json:"items"` PagingCallback Callback `json:"pagingCallback"` Callback Callback `json:"callback"` MaxResults int64 `json:"max-results"` }
type ApplicationRolesItem ¶
type ApplicationRolesItem struct { Key string `json:"key"` Groups []string `json:"groups"` Name string `json:"name"` DefaultGroups []string `json:"defaultGroups"` SelectedByDefault bool `json:"selectedByDefault"` Defined bool `json:"defined"` NumberOfSeats int64 `json:"numberOfSeats"` RemainingSeats int64 `json:"remainingSeats"` UserCount int64 `json:"userCount"` UserCountDescription string `json:"userCountDescription"` HasUnlimitedSeats bool `json:"hasUnlimitedSeats"` Platform bool `json:"platform"` }
type Attachment ¶
type Attachment struct { ID int64 `json:"id"` Self string `json:"self"` Filename string `json:"filename"` Author AttachmentAuthor `json:"author"` Created string `json:"created"` Size int64 `json:"size"` MIMEType string `json:"mimeType"` Content string `json:"content"` Thumbnail string `json:"thumbnail"` MediaAPIFileID string `json:"mediaApiFileId"` }
type AttachmentAuthor ¶
type AuthorElement ¶
type AvatarUrls ¶
type Backend ¶
type Backend interface { // Call is the implementation for invoking Jira APIs. // // Body is marshalled into the request body and the response body is decoded into v. Call(method, path, username, password string, body interface{}, v interface{}) (*http.Response, error) }
Backend is an interface for making calls against a Jira service. This interface exists to enable mocking for during testing if needed.
func NewBackend ¶
type BackendImplementation ¶
func (*BackendImplementation) BasicAuth ¶
func (s *BackendImplementation) BasicAuth(username, password string) string
BasicAuth returns the username and password user-id/password pair, encoded using Base64. See: https://datatracker.ietf.org/doc/html/rfc7617
func (*BackendImplementation) Call ¶
func (s *BackendImplementation) Call(method, path, username, password string, body interface{}, v interface{}) (*http.Response, error)
Call is the implementation for invoking Jira APIs.
func (*BackendImplementation) Do ¶
Do is used by Call to execute an API request and parse the response. It uses the backend's HTTP client to execute the request and unmarshals the response into v.
func (*BackendImplementation) NewRequest ¶
func (s *BackendImplementation) NewRequest(method, path, auth, contentType string, body interface{}) (*http.Request, error)
NewRequest is used by Call to generate an http.Request. It handles encoding parameters and attaching the appropriate headers.
type Comment ¶
type Comment struct { Self string `json:"self"` ID string `json:"id"` Author AuthorElement `json:"author"` Body Description `json:"body"` UpdateAuthor AuthorElement `json:"updateAuthor"` Created string `json:"created"` Updated string `json:"updated"` Visibility Visibility `json:"visibility"` }
type ContentContent ¶
type Description ¶
type Description struct { Type string `json:"type"` Version int64 `json:"version"` Content []DescriptionContent `json:"content"` }
type DescriptionContent ¶
type DescriptionContent struct { Type string `json:"type"` Content []ContentContent `json:"content"` }
type Groups ¶
type Groups struct { Size int64 `json:"size"` Items []GroupsItem `json:"items"` PagingCallback Callback `json:"pagingCallback"` Callback Callback `json:"callback"` MaxResults int64 `json:"max-results"` }
type GroupsItem ¶
type InwardIssueFields ¶
type InwardIssueFields struct {
Status Status `json:"status"`
}
type IssueBean ¶
type IssueBean struct { Expand string `json:"expand"` ID string `json:"id"` Self string `json:"self"` Key string `json:"key"` Fields IssueBeanFields `json:"fields"` }
func UnmarshalIssueBean ¶
type IssueBeanFields ¶
type IssueBeanFields struct { Issuetype Issuetype `json:"issuetype"` Watcher Watcher `json:"watcher"` Attachment []Attachment `json:"attachment"` SubTasks []Issuelink `json:"sub-tasks"` Description Description `json:"description"` Project Project `json:"project"` Comment []Comment `json:"comment"` Issuelinks []Issuelink `json:"issuelinks"` Worklog []Worklog `json:"worklog"` Updated int64 `json:"updated"` Summary string `json:"summary"` }
type IssueResource ¶
type IssueResource interface { // GetIssue returns the details for an issue. GetIssue(key string) (IssueBean, error) }
This resource represents Jira issues.
type JiraClient ¶
type JiraClient interface { // SaveToKeyring saves the credentials of the current client to the // system keyring. SaveToKeyring(service, user string) error MyselfResource IssueResource }
func InitializeApiFromInit ¶
func InitializeApiFromInit(email, domain, token string) JiraClient
InitializeApiFromInit returns a new instance of JiraClient based on the passed init command values.
func NewJiraClient ¶
func NewJiraClient(service, user string) (JiraClient, error)
NewJiraClient returns a new instance of JiraApi with credentials gathered from the local keyring.
type JiraCredentials ¶
type MyselfResource ¶
type MyselfResource interface { // GetCurrentUser returns details for the current user. GetCurrentUser() (User, error) }
This resource represents information about the current user, such as basic details, group membership, application roles, preferences, and locale. Use it to get, create, update, and delete (restore default) values of the user's preferences and locale.
type Project ¶
type Project struct { Self string `json:"self"` ID string `json:"id"` Key string `json:"key"` Name string `json:"name"` AvatarUrls AvatarUrls `json:"avatarUrls"` ProjectCategory ProjectCategory `json:"projectCategory"` Simplified bool `json:"simplified"` Style string `json:"style"` Insight Insight `json:"insight"` }
type ProjectCategory ¶
type Timetracking ¶
type Timetracking struct { OriginalEstimate string `json:"originalEstimate"` RemainingEstimate string `json:"remainingEstimate"` TimeSpent string `json:"timeSpent"` OriginalEstimateSeconds int64 `json:"originalEstimateSeconds"` RemainingEstimateSeconds int64 `json:"remainingEstimateSeconds"` TimeSpentSeconds int64 `json:"timeSpentSeconds"` }
type User ¶
type User struct { Self string `json:"self"` Key string `json:"key"` AccountID string `json:"accountId"` AccountType string `json:"accountType"` Name string `json:"name"` EmailAddress string `json:"emailAddress"` AvatarUrls AvatarUrls `json:"avatarUrls"` DisplayName string `json:"displayName"` Active bool `json:"active"` TimeZone string `json:"timeZone"` Locale string `json:"locale"` Groups Groups `json:"groups"` ApplicationRoles ApplicationRoles `json:"applicationRoles"` Expand string `json:"expand"` }
func UnmarshalUser ¶
type Visibility ¶
type WardIssue ¶
type WardIssue struct { ID string `json:"id"` Key string `json:"key"` Self string `json:"self"` Fields InwardIssueFields `json:"fields"` }
type Watcher ¶
type Watcher struct { Self string `json:"self"` IsWatching bool `json:"isWatching"` WatchCount int64 `json:"watchCount"` Watchers []AuthorElement `json:"watchers"` }
type Worklog ¶
type Worklog struct { Self string `json:"self"` Author AuthorElement `json:"author"` UpdateAuthor AuthorElement `json:"updateAuthor"` Comment Description `json:"comment"` Updated string `json:"updated"` Visibility Visibility `json:"visibility"` Started string `json:"started"` TimeSpent string `json:"timeSpent"` TimeSpentSeconds int64 `json:"timeSpentSeconds"` ID string `json:"id"` IssueID string `json:"issueId"` }