gitee

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 8 Imported by: 0

README

Gitee SDK

Description

A Golang SDK that provides functionality of Gitee API. It allows you to interact with Gitee's API v8.

Features

  • Issues

Usage

Coming soon.

API Documentation

Coming soon.

Contributing

Contributions are welcome!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignee

type Assignee struct {
	ID                 int    `json:"id"`
	Username           string `json:"username"`
	Name               string `json:"name"`
	Remark             string `json:"remark"`
	Pinyin             string `json:"pinyin"`
	AvatarURL          string `json:"avatar_url"`
	IsEnterpriseMember bool   `json:"is_enterprise_member"`
	IsHistoryMember    bool   `json:"is_history_member"`
	Outsourced         bool   `json:"outsourced"`
}

type Author

type Author struct {
	ID                 int    `json:"id"`
	Username           string `json:"username"`
	Name               string `json:"name"`
	Remark             string `json:"remark"`
	Pinyin             string `json:"pinyin"`
	AvatarURL          string `json:"avatar_url"`
	IsEnterpriseMember bool   `json:"is_enterprise_member"`
	IsHistoryMember    bool   `json:"is_history_member"`
	Outsourced         bool   `json:"outsourced"`
}

type Client

type Client struct {
	Client     *http.Client
	APIBase    string
	CookiesJar string
	Log        io.Writer // If user set log file name all requests will be logged there
	// contains filtered or unexported fields
}

Client represents a Paypal REST API Client

func NewClient

func NewClient(apiBase string) *Client

NewClient returns new Client struct APIBase is a base API URL

func (*Client) ListIssues

func (c *Client) ListIssues(ctx context.Context, enterpriseId int, params *IssueListParams) (*ListIssuesResponse, error)

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, url string, payload interface{}) (*http.Request, error)

NewRequest constructs a request Convert payload to a JSON

func (*Client) Send

func (c *Client) Send(req *http.Request, v interface{}) error

Send makes a request to the API, the response body will be unmarshalled into v, or if v is an io.Writer, the response will be written to it without decoding

func (*Client) SendWithCookies

func (c *Client) SendWithCookies(req *http.Request, v interface{}) error

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

SetHTTPClient sets *http.Client to current client

func (*Client) SetHTTPCookies

func (c *Client) SetHTTPCookies(cookiesJar string)

SetHTTPClient sets cookies to current client

func (*Client) SetLog

func (c *Client) SetLog(log io.Writer)

SetLog will set/change the output destination. If log file is set paypal will log all requests and responses to this Writer

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response `json:"-"`
	Message  string         `json:"message"`
}

ErrorResponse

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type Issue

type Issue struct {
	ID                 int        `json:"id"`
	RootID             int        `json:"root_id"`
	ParentID           int        `json:"parent_id"`
	ProjectID          int        `json:"project_id"`
	Ident              string     `json:"ident"`
	Title              string     `json:"title"`
	IssueStateID       int        `json:"issue_state_id"`
	ProgramID          int        `json:"program_id"`
	State              string     `json:"state"`
	CommentsCount      int        `json:"comments_count"`
	Priority           int        `json:"priority"`
	Branch             string     `json:"branch"`
	PriorityHuman      string     `json:"priority_human"`
	Assignee           Assignee   `json:"assignee"`
	Duration           int        `json:"duration"`
	CreatedAt          string     `json:"created_at"`
	UpdatedAt          string     `json:"updated_at"`
	Author             Author     `json:"author"`
	IssueState         IssueState `json:"issue_state"`
	IssueType          IssueType  `json:"issue_type"`
	PlanStartedAt      string     `json:"plan_started_at,omitempty"`
	Deadline           string     `json:"deadline,omitempty"`
	FinishedAt         string     `json:"finished_at,omitempty"`
	StartedAt          string     `json:"started_at,omitempty"`
	SecurityHole       bool       `json:"security_hole"`
	IsStar             bool       `json:"is_star"`
	EstimatedDuration  int        `json:"estimated_duration"`
	RegisteredDuration int        `json:"registered_duration"`
}

type IssueListParams

type IssueListParams struct {
	ProjectID       string `json:"project_id,omitempty"`
	ProgramID       string `json:"program_id,omitempty"`
	MilestoneID     string `json:"milestone_id,omitempty"`
	State           string `json:"state,omitempty"`
	OnlyRelatedMe   string `json:"only_related_me,omitempty"`
	AssigneeID      string `json:"assignee_id,omitempty"`
	AuthorID        string `json:"author_id,omitempty"`
	CollaboratorIDs string `json:"collaborator_ids,omitempty"`
	CreatedAt       string `json:"created_at,omitempty"`
	FinishedAt      string `json:"finished_at,omitempty"`
	PlanStartedAt   string `json:"plan_started_at,omitempty"`
	Deadline        string `json:"deadline,omitempty"`
	Search          string `json:"search,omitempty"`
	FilterChild     string `json:"filter_child,omitempty"`
	IssueStateIDs   string `json:"issue_state_ids,omitempty"`
	IssueTypeID     string `json:"issue_type_id,omitempty"`
	LabelIDs        string `json:"label_ids,omitempty"`
	Priority        string `json:"priority,omitempty"`
	Sort            string `json:"sort,omitempty"`
	Direction       string `json:"direction,omitempty"`
	Page            string `json:"page,omitempty"`
	PerPage         string `json:"per_page,omitempty"`
}

type IssueState

type IssueState struct {
	IssueState string      `json:"issue_state"`
	ID         int         `json:"id"`
	Title      string      `json:"title"`
	Color      string      `json:"color"`
	Icon       string      `json:"icon"`
	Command    string      `json:"command"`
	Serial     int         `json:"serial"`
	IssueTypes []IssueType `json:"issue_types"`
	CreatedAt  string      `json:"created_at"`
	UpdatedAt  string      `json:"updated_at"`
}

type IssueType

type IssueType struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	Template    string `json:"template"`
	Ident       string `json:"ident"`
	Color       string `json:"color"`
	IsSystem    bool   `json:"is_system"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	Category    string `json:"category"`
	Description string `json:"description"`
}

type ListIssuesResponse

type ListIssuesResponse struct {
	Issues []Issue `json:"data"`
	SharedListResponse
}

type SharedListResponse

type SharedListResponse struct {
	TotalCount int `json:"total_count,omitempty"`
}

Jump to

Keyboard shortcuts

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