Documentation ¶
Index ¶
- type APIError
- type GlobalRes
- type SrewClient
- func (c *SrewClient) CreatePlugin(plugin index.Plugin) (*pluginCreateData, error)
- func (c *SrewClient) DeletePlugin(project_name, plugin_version string) (*pluginData, error)
- func (c *SrewClient) IsLogged() bool
- func (c *SrewClient) ListPlugin(plugin_name, plugin_version string) (*pluginDetailData, error)
- func (c *SrewClient) ListPluginAllVersion(plugin_name string) (*pluginAllData, error)
- func (c *SrewClient) LoginWithToken(BearerAuthToken string) *SrewClient
- func (c *SrewClient) SearchPlugin(plugin_name, plugin_version string) (*pluginDetailData, error)
- func (c *SrewClient) SearchPluginAllVersion(plugin_name string) (*pluginAllData, error)
- func (c *SrewClient) SetDebug(enable bool) *SrewClient
- func (c *SrewClient) UpdatePlugin(plugin index.Plugin) (*pluginData, error)
- func (c *SrewClient) User_Login(username, password string) (*UserData, error)
- func (c *SrewClient) User_VerifyToken(token string) (*UserData, error)
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Code int `json:"code"` Data interface{} `json:"data,omitempty"` Msg string `json:"msg"` Errors []struct { Resource string `json:"resource"` Field string `json:"field"` Code string `json:"code"` } `json:"errors,omitempty"` }
APIError represents the error message that GitHub API returns. GitHub API doc: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#client-errors
type SrewClient ¶
type SrewClient struct { *req.Client // contains filtered or unexported fields }
GithubClient is the go client for GitHub API.
func NewGithubClient ¶
func NewGithubClient(baseurl string) *SrewClient
NewGithubClient create a GitHub client.
func (*SrewClient) CreatePlugin ¶
func (c *SrewClient) CreatePlugin(plugin index.Plugin) (*pluginCreateData, error)
CreatePlugin /plugin/create
func (*SrewClient) DeletePlugin ¶
func (c *SrewClient) DeletePlugin(project_name, plugin_version string) (*pluginData, error)
DeletePlugin /plugin/delete
func (*SrewClient) IsLogged ¶
func (c *SrewClient) IsLogged() bool
IsLogged return true is user is logged in, otherwise false.
func (*SrewClient) ListPlugin ¶
func (c *SrewClient) ListPlugin(plugin_name, plugin_version string) (*pluginDetailData, error)
ListPlugin /plugin/list [get]
func (*SrewClient) ListPluginAllVersion ¶
func (c *SrewClient) ListPluginAllVersion(plugin_name string) (*pluginAllData, error)
ListPluginAllVersion /plugin/listall [get]
func (*SrewClient) LoginWithToken ¶
func (c *SrewClient) LoginWithToken(BearerAuthToken string) *SrewClient
LoginWithToken login with GitHub personal access token.
func (*SrewClient) SearchPlugin ¶
func (c *SrewClient) SearchPlugin(plugin_name, plugin_version string) (*pluginDetailData, error)
SearchPlugin /plugin/search [get]
func (*SrewClient) SearchPluginAllVersion ¶
func (c *SrewClient) SearchPluginAllVersion(plugin_name string) (*pluginAllData, error)
SearchPluginAllVersion /plugin/searchall [get]
func (*SrewClient) SetDebug ¶
func (c *SrewClient) SetDebug(enable bool) *SrewClient
SetDebug enable debug if set to true, disable debug if set to false.
func (*SrewClient) UpdatePlugin ¶
func (c *SrewClient) UpdatePlugin(plugin index.Plugin) (*pluginData, error)
UpdatePlugin /plugin/update
func (*SrewClient) User_Login ¶
func (c *SrewClient) User_Login(username, password string) (*UserData, error)
User_Login /user/login
func (*SrewClient) User_VerifyToken ¶
func (c *SrewClient) User_VerifyToken(token string) (*UserData, error)
User_VerifyToken /user/verifyToken