gitee

package
v1.0.113 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiV5UserResponse

type ApiV5UserResponse struct {
	Id                int64     `json:"id"`
	Login             string    `json:"login"`
	Name              string    `json:"name"`
	AvatarUrl         string    `json:"avatar_url"`
	Url               string    `json:"url"`
	HtmlUrl           string    `json:"html_url"`
	FollowersUrl      string    `json:"followers_url"`
	FollowingUrl      string    `json:"following_url"`
	GistsUrl          string    `json:"gists_url"`
	StarredUrl        string    `json:"starred_url"`
	SubscriptionsUrl  string    `json:"subscriptions_url"`
	OrganizationsUrl  string    `json:"organizations_url"`
	ReposUrl          string    `json:"repos_url"`
	EventsUrl         string    `json:"events_url"`
	ReceivedEventsUrl string    `json:"received_events_url"`
	Type              string    `json:"type"`
	Blog              string    `json:"blog"`
	Weibo             string    `json:"weibo"`
	Bio               string    `json:"bio"`
	PublicRepos       int       `json:"public_repos"`
	PublicGists       int       `json:"public_gists"`
	Followers         int       `json:"followers"`
	Following         int       `json:"following"`
	Stared            int       `json:"stared"`
	Watched           int       `json:"watched"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
	Email             string    `json:"email"`
}

type ApiV5UserResult

type ApiV5UserResult struct {
	Result ApiV5UserResponse  // 结果
	Body   []byte             // 内容
	Http   gorequest.Response // 请求
	Err    error              // 错误
}

type Client

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

func NewClient

func NewClient(config *ConfigClient) (*Client, error)

func (*Client) ApiV5User

func (c *Client) ApiV5User(accessToken string) *ApiV5UserResult

ApiV5User 获取授权用户的资料 https://gitee.com/api/v5/swagger#/getV5User

func (*Client) OauthAuthorize

func (c *Client) OauthAuthorize() string

OauthAuthorize 获取登录地址

func (*Client) OauthToken

func (c *Client) OauthToken(code string) *OauthTokenResult

OauthToken OAuth2 获取 AccessToken 认证步骤 https://gitee.com/api/v5/oauth_doc#/list-item-2

type ConfigClient

type ConfigClient struct {
	ClientID     string
	ClientSecret string
	RedirectUri  string
	PgsqlDb      *gorm.DB // 日志数据库
}

type OauthTokenResponse

type OauthTokenResponse struct {
	AccessToken string `json:"access_token"`
}

type OauthTokenResult

type OauthTokenResult struct {
	Result OauthTokenResponse // 结果
	Body   []byte             // 内容
	Http   gorequest.Response // 请求
	Err    error              // 错误
}

Jump to

Keyboard shortcuts

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