Documentation ¶
Index ¶
- func GetKeyTitle(rawurl string) (string, error)
- func GetRandom() string
- func IsAdmin(proj *gogitlab.Project) bool
- func IsRead(proj *gogitlab.Project) bool
- func IsWrite(proj *gogitlab.Project) bool
- func NewClient(url, accessToken string, skipVerify bool) *gogitlab.Gitlab
- func NewOauthConfig(g *Gitlab, host string) *oauth.Config
- func Register()
- type Gitlab
- func (r *Gitlab) Activate(user *model.User, repo *model.Repo, link string) error
- func (r *Gitlab) Authorize(res http.ResponseWriter, req *http.Request) (*model.Login, error)
- func (r *Gitlab) Deactivate(user *model.User, repo *model.Repo, link string) error
- func (r *Gitlab) GetHost() string
- func (r *Gitlab) GetKind() string
- func (r *Gitlab) GetRepos(user *model.User) ([]*model.Repo, error)
- func (r *Gitlab) GetScript(user *model.User, repo *model.Repo, hook *model.Hook) ([]byte, error)
- func (r *Gitlab) GetToken(user *model.User) (*model.Token, error)
- func (r *Gitlab) OpenRegistration() bool
- func (r *Gitlab) ParseHook(req *http.Request) (*model.Hook, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeyTitle ¶
GetKeyTitle is a helper function that generates a title for the RSA public key based on the username and domain name.
func GetRandom ¶
func GetRandom() string
GetRandom is a helper function that generates a 32-bit random key, base32 encoded as a string value.
func IsAdmin ¶
func IsAdmin(proj *gogitlab.Project) bool
IsAdmin is a helper function that returns true if the user has Admin access to the repository.
func IsRead ¶
func IsRead(proj *gogitlab.Project) bool
IsRead is a helper function that returns true if the user has Read-only access to the repository.
func IsWrite ¶
func IsWrite(proj *gogitlab.Project) bool
IsWrite is a helper function that returns true if the user has Read-Write access to the repository.
Types ¶
type Gitlab ¶
type Gitlab struct { SkipVerify bool Open bool Client string Secret string // contains filtered or unexported fields }
func (*Gitlab) Activate ¶
Activate activates a repository by adding a Post-commit hook and a Public Deploy key, if applicable.
func (*Gitlab) Authorize ¶
Authorize handles authentication with thrid party remote systems, such as github or bitbucket, and returns user data.
func (*Gitlab) Deactivate ¶
Deactivate removes a repository by removing all the post-commit hooks which are equal to link and removing the SSH deploy key.
func (*Gitlab) GetRepos ¶
GetRepos fetches all repositories that the specified user has access to in the remote system.
func (*Gitlab) GetScript ¶
GetScript fetches the build script (.drone.yml) from the remote repository and returns in string format.