gogs

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: 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
}

func New

func New(url string, secret string) *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) 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) 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