Documentation ¶
Index ¶
- Constants
- func BasicAuthentication(username, token string) string
- func WithBasicAuthentication(username, token string) func(*Client) error
- func WithHTTPClient(client *http.Client) func(*Client) error
- func WithUserAgent(userAgent string) func(*Client) error
- type ApplicationRoles
- type ApplicationRolesItem
- type AvatarUrls
- type Callback
- type Client
- type Groups
- type GroupsItem
- type Issue
- type IssueFields
- type IssueResourceService
- type IssueType
- type MyselfResourceService
- type User
Constants ¶
const ( // BaseURLTemplate is the template for the Jira API base URL. BaseURLTemplate = "https://%s.atlassian.net" // DefaultTimeout is the default timeout for the HTTP client. DefaultTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func BasicAuthentication ¶ added in v0.3.0
BasicAuthentication returns the username and token user-id/password pair, encoded using Base64. See: https://datatracker.ietf.org/doc/html/rfc7617
func WithBasicAuthentication ¶ added in v0.3.0
WithBasicAuthentication returns an option to set the username and token for the client.
func WithHTTPClient ¶ added in v0.3.0
WithHTTPClient returns an option to set the HTTP client for the client.
func WithUserAgent ¶ added in v0.3.0
WithUserAgent returns an option to set the User-Agent for the client.
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 AvatarUrls ¶
type Client ¶ added in v0.3.0
type Client struct { // BaseURL is the base URL for the Jira API. BaseURL url.URL // UserAgent is the User-Agent string used when making API requests // to the Jira API. UserAgent string Issue *IssueResourceService Myself *MyselfResourceService // contains filtered or unexported fields }
Client manages communication with the Jira API.
func (*Client) Do ¶ added in v0.3.0
Do sends an API request and returns the API response. The API response is decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.
func (*Client) NewRequest ¶ added in v0.3.0
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client.
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 Issue ¶ added in v0.3.0
type Issue struct { Expand string `json:"expand"` ID string `json:"id"` Self string `json:"self"` Key string `json:"key"` Fields IssueFields `json:"fields"` }
type IssueFields ¶ added in v0.3.0
type IssueResourceService ¶ added in v0.3.0
type IssueResourceService struct {
// contains filtered or unexported fields
}
type MyselfResourceService ¶ added in v0.3.0
type MyselfResourceService struct {
// contains filtered or unexported fields
}
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"` }