tasks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectBoard

func CollectBoard(jiraApiClient *JiraApiClient, source *models.JiraSource, boardId uint64) error

func CollectChangelogs

func CollectChangelogs(
	jiraApiClient *JiraApiClient,
	source *models.JiraSource,
	boardId uint64,
	ctx context.Context,
) error

func CollectIssues

func CollectIssues(
	jiraApiClient *JiraApiClient,
	source *models.JiraSource,
	boardId uint64,
	since time.Time,
	ctx context.Context,
) error

func CollectProjects added in v0.4.0

func CollectProjects(
	jiraApiClient *JiraApiClient,
	sourceId uint64,
) error

func CollectSprint added in v0.4.0

func CollectSprint(jiraApiClient *JiraApiClient, source *models.JiraSource, boardId uint64) error

func CollectUsers added in v0.4.0

func CollectUsers(jiraApiClient *JiraApiClient,
	sourceId uint64,
) error

func EnrichIssues

func EnrichIssues(source *models.JiraSource, boardId uint64) (err error)

Types

type JiraApiAuthor

type JiraApiAuthor struct {
	Self        string `json:"self,omitempty"`
	AccountId   string `json:"accountId,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	Active      bool   `json:"active,omitempty"`
	TimeZone    string `json:"timeZone,omitempty"`
	AccountType string `json:"accountType,omitempty"`
}

type JiraApiBoard

type JiraApiBoard struct {
	Id       uint64 `json:"id"`
	Self     string `json:"self"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	Location *JiraApiLocation
}

type JiraApiChangeLog

type JiraApiChangeLog struct {
	Id      string                 `json:"id,omitempty"`
	Author  JiraApiAuthor          `json:"author,omitempty"`
	Created core.Iso8601Time       `json:"created,omitempty"`
	Items   []JiraApiChangelogItem `json:"items,omitempty"`
}

type JiraApiChangelogItem

type JiraApiChangelogItem struct {
	Field      string `json:"field,omitempty"`
	FieldType  string `json:"fieldType,omitempty"`
	FieldId    string `json:"fieldId,omitempty"`
	From       string `json:"from,omitempty"`
	FromString string `json:"fromString,omitempty"`
	To         string `json:"to,omitempty"`
	ToString   string `json:"toString,omitempty"`
}

type JiraApiChangelogsResponse

type JiraApiChangelogsResponse struct {
	JiraPagination
	Values []JiraApiChangeLog `json:"values,omitempty"`
}

type JiraApiClient

type JiraApiClient struct {
	core.ApiClient
}

func NewJiraApiClient added in v0.4.0

func NewJiraApiClient(endpoint string, auth string) *JiraApiClient

func NewJiraApiClientBySourceId added in v0.4.0

func NewJiraApiClientBySourceId(sourceId uint64) (*JiraApiClient, error)

func (*JiraApiClient) FetchPages

func (jiraApiClient *JiraApiClient) FetchPages(scheduler *utils.WorkerScheduler, path string, query *url.Values, handler JiraPaginationHandler) error

func (*JiraApiClient) FetchWithoutPaginationHeaders added in v0.4.0

func (jiraApiClient *JiraApiClient) FetchWithoutPaginationHeaders(
	path string,
	query *url.Values,
	handler JiraSearchPaginationHandler,
) error

FetchWithoutPaginationHeaders uses pagination in a different way than FetchPages. We set the pagination params to what we want, and then we just keep making requests until the response array is empty. This is why we need to check the "next" variable on the handler, and the handler that is passed in needs to return a boolean to tell us whether or not to continue making requests. This is why we created JiraSearchPaginationHandler.

type JiraApiIssue

type JiraApiIssue struct {
	Id     string                 `json:"id"`
	Self   string                 `json:"self"`
	Key    string                 `json:"key"`
	Fields map[string]interface{} `json:"fields"`
}

type JiraApiIssuesResponse

type JiraApiIssuesResponse struct {
	JiraPagination
	Issues []JiraApiIssue `json:"issues"`
}

type JiraApiLocation

type JiraApiLocation struct {
	ProjectId      uint   `json:"projectId"`
	DisplayName    string `json:"displayName"`
	ProjectName    string `json:"projectName"`
	ProjectKey     string `json:"projectKey"`
	ProjectTypeKey string `json:"projectTypeKey"`
	AvatarURI      string `json:"avatarURI"`
	Name           string `json:"name"`
}

type JiraApiSprint added in v0.4.0

type JiraApiSprint struct {
	MaxResults int      `json:"maxResults"`
	StartAt    int      `json:"startAt"`
	Total      int      `json:"total"`
	IsLast     bool     `json:"isLast"`
	Values     []Sprint `json:"values"`
}

type JiraApiUser added in v0.4.0

type JiraApiUser struct {
	AccountId   string `json:"accountId"`
	AccountType string `json:"accountType"`
	Name        string `json:"displayName"`
	Email       string `json:"emailAddress"`
	Timezone    string `json:"timeZone"`
	AvatarUrls  struct {
		Url string `json:"48x48"`
	} `json:"avatarUrls"`
}

type JiraPagination

type JiraPagination struct {
	StartAt    int `json:"startAt"`
	MaxResults int `json:"maxResults"`
	Total      int `json:"total"`
}

type JiraPaginationHandler

type JiraPaginationHandler func(res *http.Response) error

type JiraProject added in v0.4.0

type JiraProject struct {
	Id   string `json:"id"`
	Key  string `json:"key"`
	Name string `json:"name"`
}

type JiraSearchPaginationHandler added in v0.4.0

type JiraSearchPaginationHandler func(res *http.Response) (int, error)

type JiraUserApiRes added in v0.4.0

type JiraUserApiRes []JiraApiUser

type JiraUserProjectApiRes added in v0.4.0

type JiraUserProjectApiRes []JiraProject

This has to be called JiraUserProjects since it is a different api call than JiraProjects. This call retreives all projects that the user has access to

type Sprint added in v0.4.0

type Sprint struct {
	ID            uint64     `json:"id"`
	Self          string     `json:"self"`
	State         string     `json:"state"`
	Name          string     `json:"name"`
	StartDate     *time.Time `json:"startDate,omitempty"`
	EndDate       *time.Time `json:"endDate,omitempty"`
	CompleteDate  *time.Time `json:"completeDate,omitempty"`
	OriginBoardID uint64     `json:"originBoardId,omitempty"`
}

Jump to

Keyboard shortcuts

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