api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package api handle api layer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	IsPrivate bool   `json:"isPrivate"`
}

type BoardsResponse

type BoardsResponse struct {
	IsLast bool    `json:"isLast"`
	Boards []Board `json:"values"`
}

type Client

type Client interface {
	GetProjects() (ProjectResponse, error)
	GetBoards(projectID string) (BoardsResponse, error)
	GetSprints(boardID string) (SprintsResponse, error)
	GetActiveSprint(boardID string) (Sprint, error)
	GetSprintIssues(sprintID int) (SprintIssuesResponse, error)
}

func GetClient

func GetClient() Client

func NewClient

func NewClient(
	username string,
	token string,
	domain string,
) (*Client, error)

func NewMockClient

func NewMockClient(basePath string) (*Client, error)

type EmptyResponse

type EmptyResponse struct{}

type Issue

type Issue struct {
	ID     string      `json:"id"`
	Fields IssueFields `json:"fields"`
}

type IssueAssignee

type IssueAssignee struct {
	AccountID string `json:"accountId"`
	Name      string `json:"displayName"`
}

type IssueComponent

type IssueComponent struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type IssueFields

type IssueFields struct {
	Assignee    IssueAssignee     `json:"assignee"`
	Status      IssueStatus       `json:"status"`
	Summary     string            `json:"summary"`
	Description string            `json:"description"`
	Sprint      Sprint            `json:"sprint"`
	FixVersions []IssueFixVersion `json:"fixVersions"`
	StoryPoints float32           `json:"customfield_10024"`
	Components  []IssueComponent  `json:"components"`
}

type IssueFixVersion

type IssueFixVersion struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type IssueStatus

type IssueStatus struct {
	Name string `json:"name"`
}

type MockClient

type MockClient struct {
	BasePath string
}

func (MockClient) GetActiveSprint

func (c MockClient) GetActiveSprint(boardID string) (Sprint, error)

func (MockClient) GetBoards

func (c MockClient) GetBoards(projectID string) (BoardsResponse, error)

func (MockClient) GetProjects

func (c MockClient) GetProjects() (ProjectResponse, error)

func (MockClient) GetSprintIssues

func (c MockClient) GetSprintIssues(sprintID int) (SprintIssuesResponse, error)

func (MockClient) GetSprints

func (c MockClient) GetSprints(boardID string) (SprintsResponse, error)

type Project

type Project struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	ProjectTypeKey string `json:"projectTypeKey"`
}

type ProjectResponse

type ProjectResponse struct {
	IsLast   bool      `json:"isLast"`
	Projects []Project `json:"values"`
}

type RealClient

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

func (*RealClient) Do

func (c *RealClient) Do(
	method string,
	path string,
	body io.Reader,
) (*http.Response, error)

func (RealClient) GetActiveSprint

func (c RealClient) GetActiveSprint(boardID string) (Sprint, error)

func (RealClient) GetBoards

func (c RealClient) GetBoards(projectID string) (BoardsResponse, error)

func (RealClient) GetProjects

func (c RealClient) GetProjects() (ProjectResponse, error)

func (RealClient) GetSprintIssues

func (c RealClient) GetSprintIssues(sprintID int) (SprintIssuesResponse, error)

func (RealClient) GetSprints

func (c RealClient) GetSprints(boardID string) (SprintsResponse, error)

type Sprint

type Sprint struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	StartDate string `json:"startDate"`
	EndDate   string `json:"endDate"`
	Goal      string `json:"goal"`
}

type SprintIssuesResponse

type SprintIssuesResponse struct {
	Issues []Issue `json:"issues"`
}

type SprintsResponse

type SprintsResponse struct {
	IsLast  bool     `json:"isLast"`
	Sprints []Sprint `json:"values"`
}

Jump to

Keyboard shortcuts

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