gogs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

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

Types

type Gogs

type Gogs struct {
	URL    string
	Secret string
	Open   bool
}

func New

func New(url string, secret string, open bool) *Gogs

func (*Gogs) Activate

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

Activate activates a repository

func (*Gogs) Authorize

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

Authorize handles Gogs authorization

func (*Gogs) Deactivate

func (r *Gogs) Deactivate(user *model.User, repo *model.Repo, link string) error

Deactivate removes a repository by removing all the post-commit hooks which are equal to link and removing the SSH deploy key.

func (*Gogs) GetHost

func (r *Gogs) GetHost() string

GetHost returns the hostname of this remote Gogs instance

func (*Gogs) GetKind

func (r *Gogs) GetKind() string

GetKind returns the internal identifier of this remote Gogs instance

func (*Gogs) GetRepos

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

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

func (*Gogs) GetScript

func (r *Gogs) 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 a byte array

func (*Gogs) GetToken

func (r *Gogs) GetToken(user *model.User) (*model.Token, error)

func (*Gogs) OpenRegistration

func (r *Gogs) OpenRegistration() bool

func (*Gogs) ParseHook

func (r *Gogs) 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