client

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LibraryVersion = "0.0.1"

	DefaultMaxPendingRequests = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Base URL of the Jira API that is to be used to form API requests.
	BaseURL *url.URL

	// User-Agent header to be set for every request.
	UserAgent string

	// Me service.
	Myself *MyselfService

	// Project service.
	Projects *ProjectService

	// Issue service.
	Issues *IssueService

	// Version service.
	Versions *VersionService
	// contains filtered or unexported fields
}

func New

func New(baseURL *url.URL, httpClient *http.Client, options ...func(*Client)) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, responseResource interface{}) (*http.Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlPath string, body interface{}) (*http.Request, error)

func (*Client) SetOptMaxPendingRequests

func (c *Client) SetOptMaxPendingRequests(limit int)

SetOptMaxPendingRequests can be used to set a custom queue size for the requests that are to be sent to JIRA.

It only makes sense to call this method from an option function. Calling it later on will have no effect whatsoever.

type ErrAPI

type ErrAPI struct {
	Response *http.Response
	Err      *Error
}

func (*ErrAPI) Error

func (err *ErrAPI) Error() string

type ErrFieldNotSet

type ErrFieldNotSet struct {
	// contains filtered or unexported fields
}

func (*ErrFieldNotSet) Error

func (err *ErrFieldNotSet) Error() string

type Error

type Error struct {
	ErrorMessages []string          `json:"errorMessages"`
	Errors        map[string]string `json:"errors"`
}

type Issue

type Issue struct {
	Id     string `json:"id,omitempty"`
	Self   string `json:"self,omitempty"`
	Key    string `json:"key,omitempty"`
	Fields struct {
		Summary   string `json:"summary,omitempty"`
		IssueType struct {
			Id          string `json:"id,omitempty"`
			Self        string `json:"self,omitempty"`
			Name        string `json:"name,omitempty"`
			Description string `json:"description,omitempty"`
			Subtask     bool   `json:"subtask,omitempty"`
			IconURL     string `json:"iconUrl,omitempty"`
		} `json:"issuetype,omitempty"`
		Parent      *Issue       `json:"parent,omitempty"`
		Subtasks    []*Issue     `json:"subtasks,omitempty"`
		Assignee    *User        `json:"assignee,omitempty"`
		FixVersions []*Version   `json:"fixVersions,omitempty"`
		Status      *IssueStatus `json:"status,omitempty"`
	} `json:"fields,omitempty"`
}

Issue represents the issue resource as produces by the REST API.

type IssueList

type IssueList struct {
	Expand     string   `json:"expand,omitempty"`
	StartAt    int      `json:"startAt,omitempty"`
	MaxResults int      `json:"maxResults,omitempty"`
	Total      int      `json:"total,omitempty"`
	Issues     []*Issue `json:"issues,omitempty"`
}

IssueList represents a list of issues, what a surprise.

type IssueService

type IssueService struct {
	// contains filtered or unexported fields
}

func (*IssueService) PerformTransition

func (service *IssueService) PerformTransition(issueIdOrKey, transitionId string) (*http.Response, error)

Performs the requested transition for the chosen issue.

func (*IssueService) Search

func (service *IssueService) Search(opts *SearchOptions) ([]*Issue, *http.Response, error)

func (*IssueService) Update

func (service *IssueService) Update(issueIdOrKey string, body interface{}) (*http.Response, error)

Updates issue with `issueIdOrKey`.

type IssueStatus

type IssueStatus struct {
	Id          string `json:"id,omitempty"`
	Self        string `json:"self,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IconURL     string `json:"iconUrl,omitempty"`
}

IssueStatus represents an issue status, e.g. "Scheduled".

type L

type L []interface{}

type M

type M map[string]interface{}

type MyselfService

type MyselfService struct {
	// contains filtered or unexported fields
}

func (*MyselfService) Get

func (service *MyselfService) Get() (*User, *http.Response, error)

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

func (*ProjectService) ListVersions

func (service *ProjectService) ListVersions(projectIdOrKey string) ([]*Version, *http.Response, error)

type SearchOptions

type SearchOptions struct {
	JQL           string `url:"jql,omitempty"`
	StartAt       int    `url:"startAt,omitempty"`
	MaxResults    int    `url:"maxResults,omitempty"`
	ValidateQuery bool   `url:"validateQuery,omitempty"`
}

type User

type User struct {
	Self         string `json:"self,omitempty"`
	Key          string `json:"key,omitempty"`
	Name         string `json:"name,omitempty"`
	EmailAddress string `json:"emailAddress,omitempty"`
	AvatarURLs   struct {
		Size16 string `json:"16x16,omitempty"`
		Size24 string `json:"24x24,omitempty"`
		Size32 string `json:"32x32,omitempty"`
		Size48 string `json:"48x48,omitempty"`
	} `json:"avatarUrls,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	Active      bool   `json:"active,omitempty"`
	TimeZone    string `json:"timeZone,omitempty"`
	Groups      struct {
		Size  int `json:"size,omitempty"`
		Items []struct {
			Name string `json:"name,omitempty"`
			Self string `json:"self,omitempty"`
		} `json:"items,omitempty"`
	} `json:"groups,omitempty"`
}

type Version

type Version struct {
	Id            string `json:"id,omitempty"`
	Self          string `json:"self,omitempty"`
	Name          string `json:"name,omitempty"`
	Description   string `json:"description,omitempty"`
	Project       string `json:"project,omitempty"`
	ProjectId     int    `json:"projectId,omitempty"`
	Released      bool   `json:"released,omitempty"`
	Archived      bool   `json:"archived,omitempty"`
	StartDate     string `json:"startDate,omitempty"`
	UserStartDate string `json:"userStartDate,omitempty"`
}

type VersionService

type VersionService struct {
	// contains filtered or unexported fields
}

func (*VersionService) Create

func (service *VersionService) Create(version *Version) (*Version, *http.Response, error)

Create creates a new version.

func (*VersionService) Delete

func (service *VersionService) Delete(id string) (*http.Response, error)

Delete deleted the version with the specified ID.

func (*VersionService) Update

func (service *VersionService) Update(id string, change *Version) (*http.Response, error)

Update updates the version with the specified ID as specified in the change request.

Jump to

Keyboard shortcuts

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