client

package
v0.0.0-...-47e3236 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(endpoint, token string) *request

Types

type Client

type Client struct {
	Endpoint string
	Token    string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(server, token, storagePath string) (*Client, error)

func (*Client) ArchiveProject

func (c *Client) ArchiveProject(id int64) (*model.Project, error)

func (*Client) ArchiveTask

func (c *Client) ArchiveTask(id int64) (*model.Task, error)

func (*Client) CloseTask

func (c *Client) CloseTask(id int64) (*model.Task, error)

func (*Client) CreateLabel

func (c *Client) CreateLabel(r *model.LabelCreationRequest) (*model.Label, error)

func (*Client) CreateProject

func (c *Client) CreateProject(r *model.ProjectCreationRequest) (*model.Project, error)

func (*Client) CreateTask

func (c *Client) CreateTask(r *model.TaskCreationRequest) (*model.Task, error)

func (*Client) DeleteLabel

func (c *Client) DeleteLabel(id int64) (*model.Label, error)

func (*Client) DeleteProject

func (c *Client) DeleteProject(id int64) (*model.Project, error)

func (*Client) DeleteTask

func (c *Client) DeleteTask(id int64) (*model.Task, error)

func (*Client) GetLabel

func (c *Client) GetLabel(id int64) *model.Label

func (*Client) GetLabels

func (c *Client) GetLabels() []*model.Label

func (*Client) GetProject

func (c *Client) GetProject(id int64) *model.Project

func (*Client) GetProjects

func (c *Client) GetProjects() []*model.Project

func (*Client) GetTask

func (c *Client) GetTask(id int64) *model.Task

func (*Client) GetTasks

func (c *Client) GetTasks() TaskSlice

func (*Client) MoveProject

func (c *Client) MoveProject(r *ProjectMoveRequestWithID) (*model.Project, error)

func (*Client) MoveTask

func (c *Client) MoveTask(r *TaskMoveRequestWithID) (*model.Task, error)

func (*Client) OpenTask

func (c *Client) OpenTask(id int64) (*model.Task, error)

func (*Client) Sync

func (c *Client) Sync() error

func (*Client) UnarchiveProject

func (c *Client) UnarchiveProject(id int64) (*model.Project, error)

func (*Client) UnarchiveTask

func (c *Client) UnarchiveTask(id int64) (*model.Task, error)

func (*Client) UpdateLabel

func (c *Client) UpdateLabel(r *model.LabelUpdateRequestWithID) (*model.Label, error)

func (*Client) UpdateProject

func (c *Client) UpdateProject(r *ProjectUpdateRequestWithID) (*model.Project, error)

func (*Client) UpdateTask

func (c *Client) UpdateTask(r *TaskUpdateRequestWithID) (*model.Task, error)

type LabelSlice

type LabelSlice []*model.Label

func (LabelSlice) SortByID

func (ls LabelSlice) SortByID() LabelSlice

func (LabelSlice) SortByName

func (ls LabelSlice) SortByName() LabelSlice

type ProjectMoveRequestWithID

type ProjectMoveRequestWithID struct {
	ID         int64  `json:"id"`
	PreviousID *int64 `json:"previous_id"`
}

type ProjectSlice

type ProjectSlice []*model.Project

func (ProjectSlice) FilterByIDs

func (ps ProjectSlice) FilterByIDs(ids []int64) ProjectSlice

func (ProjectSlice) FilterByName

func (ps ProjectSlice) FilterByName(pattern string) ProjectSlice

func (ProjectSlice) GetIDByIndex

func (ps ProjectSlice) GetIDByIndex(idx int) (int64, error)

func (ProjectSlice) GetIDs

func (ps ProjectSlice) GetIDs() []int64

func (ProjectSlice) GetIDsByIndexs

func (ps ProjectSlice) GetIDsByIndexs(idxs []int) ([]int64, error)

func (ProjectSlice) GetProjectByIndex

func (ps ProjectSlice) GetProjectByIndex(idx int) (*model.Project, error)

func (ProjectSlice) SortByID

func (ps ProjectSlice) SortByID() ProjectSlice

func (ProjectSlice) SortByName

func (ps ProjectSlice) SortByName() ProjectSlice

func (ProjectSlice) SortByPosition

func (ps ProjectSlice) SortByPosition() ProjectSlice

type ProjectUpdateRequestWithID

type ProjectUpdateRequestWithID struct {
	ID int64 `json:"id"`
	model.ProjectUpdateRequest
}

type ResourceSlice

type ResourceSlice interface {
	GetIDByIndex(idx int) (int64, error)
	GetIDsByIndexs(idxs []int) ([]int64, error)
}

type ResourceStatus

type ResourceStatus int
const (
	None ResourceStatus = iota
	Add
	Change
	Delete
)

type TaskMoveRequestWithID

type TaskMoveRequestWithID struct {
	ID int64 `json:"id"`
	model.TaskMoveRequest
}

type TaskSlice

type TaskSlice []*model.Task

func (TaskSlice) FilterByGreaterPriority

func (ts TaskSlice) FilterByGreaterPriority(priority model.Priority) TaskSlice

func (TaskSlice) FilterByIDs

func (ts TaskSlice) FilterByIDs(ids []int64) TaskSlice

func (TaskSlice) FilterByLessPriority

func (ts TaskSlice) FilterByLessPriority(priority model.Priority) TaskSlice

func (TaskSlice) FilterByName

func (ts TaskSlice) FilterByName(pattern *string) TaskSlice

func (TaskSlice) FilterByPriority

func (ts TaskSlice) FilterByPriority(priority model.Priority) TaskSlice

func (TaskSlice) FilterByProjectID

func (ts TaskSlice) FilterByProjectID(projectID int64) TaskSlice

func (TaskSlice) GetIDByIndex

func (ts TaskSlice) GetIDByIndex(idx int) (int64, error)

func (TaskSlice) GetIDs

func (ts TaskSlice) GetIDs() []int64

func (TaskSlice) GetIDsByIndexs

func (ts TaskSlice) GetIDsByIndexs(idxs []int) ([]int64, error)

func (TaskSlice) GetProgress

func (ts TaskSlice) GetProgress()

func (TaskSlice) GetTaskByIndex

func (ts TaskSlice) GetTaskByIndex(idx int) (*model.Task, error)

func (TaskSlice) SortByID

func (ts TaskSlice) SortByID() TaskSlice

func (TaskSlice) SortByName

func (ts TaskSlice) SortByName() TaskSlice

func (TaskSlice) SortByPosition

func (ts TaskSlice) SortByPosition() TaskSlice

type TaskUpdateRequestWithID

type TaskUpdateRequestWithID struct {
	ID int64 `json:"id"`
	model.TaskUpdateRequest
}

Jump to

Keyboard shortcuts

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