gitlab

package
v0.0.0-...-a7087c3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2014 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeyTitle

func GetKeyTitle(rawurl string) (string, error)

GetKeyTitle is a helper function that generates a title for the RSA public key based on the username and domain name.

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.

func NewClient

func NewClient(uri, token string, skipVerify bool) *gogitlab.Gitlab

NewClient is a helper function that returns a new GitHub client using the provided OAuth token.

func Register

func Register()

Registers the Gitlab plugin using the default settings from the config file or environment variables.

Types

type Gitlab

type Gitlab struct {
	SkipVerify bool
	// contains filtered or unexported fields
}

func New

func New(url string, skipVerify bool) *Gitlab

func (*Gitlab) Activate

func (r *Gitlab) Activate(user *model.User, repo *model.Repo, link string) error

Activate activates a repository by adding a Post-commit hook and a Public Deploy key, if applicable.

func (*Gitlab) Authorize

func (r *Gitlab) Authorize(res http.ResponseWriter, req *http.Request) (*model.Login, error)

Authorize handles authentication with thrid party remote systems, such as github or bitbucket, and returns user data.

func (*Gitlab) GetHost

func (r *Gitlab) GetHost() string

GetHost returns the hostname of this remote GitHub instance.

func (*Gitlab) GetKind

func (r *Gitlab) GetKind() string

GetKind returns the identifier of this remote GitHub instane.

func (*Gitlab) GetRepos

func (r *Gitlab) GetRepos(user *model.User) ([]*model.Repo, error)

GetRepos fetches all repositories that the specified user has access to in the remote system.

func (*Gitlab) GetScript

func (r *Gitlab) GetScript(user *model.User, repo *model.Repo, hook *model.Hook) ([]byte, error)

GetScript fetches the build script (.drone.yml) from the remote repository and returns in string format.

func (*Gitlab) ParseHook

func (r *Gitlab) ParseHook(req *http.Request) (*model.Hook, error)

ParseHook parses the post-commit hook from the Request body and returns the required data in a standard format.

Jump to

Keyboard shortcuts

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