Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorization ¶
type Authorization struct { // Specified the authorization name. Name string `json:"name"` // Specified the repository type // The valid values are: devcloud, github, gitlab, gitee and bitbucket。 RepoType string `json:"repo_type"` // Specified the repository address. RepoHost string `json:"repo_host"` // Specified the repository homepage. RepoHome string `json:"repo_home"` // Specified the repository username. RepoUser string `json:"repo_user"` // Specified the repository avatar. Avartar string `json:"avartar"` // Specified the authorization mode. TokenType string `json:"token_type"` // Specified the creation time. CreateTime int `json:"create_time"` // Specified the update time. UpdateTime int `json:"update_time"` // Specified the authorization status. Status int `json:"status"` }
Authorization is the structure that represents the detail of the repository authorization.
func CreatePersonalAuth ¶
func CreatePersonalAuth(c *golangsdk.ServiceClient, rType string, opts PersonalAuthOpts) (*Authorization, error)
CreatePersonalAuth is a method to create the personal access token authorization.
func CreatePwdAuth ¶
func CreatePwdAuth(c *golangsdk.ServiceClient, rType string, opts PwdAuthOpts) (*Authorization, error)
CreatePwdAuth is a method to create password authorization for a Git repository.
func List ¶
func List(c *golangsdk.ServiceClient) ([]Authorization, error)
List is a method to obtain the authorization list of the repositories.
type PersonalAuthOpts ¶
type PersonalAuthOpts struct { // Specified the authorization name. Name string `json:"name" required:"true"` // Specified the repository address. Host string `json:"host" required:"true"` // Specified the repository token. Token string `json:"token" required:"true"` }
PersonalAuthOpts is the structure required by the CreatePersonalAuth method to create the authorization.
type PwdAuthOpts ¶
type PwdAuthOpts struct { // Specified the authorization name. Name string `json:"name" required:"true"` // Specified the base64 encoded token, before encoding, the format is '{account name}:{password}'. Token string `json:"token" required:"true"` }
PwdAuthOpts is the structure required by the CreatePwdAuth method to create the authorization.
Click to show internal directories.
Click to hide internal directories.