remote

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2015 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(remote Remote)

Register registers a plugin by name.

All plugins must be registered when the application initializes. This should not be invoked while the application is running, and is not thread safe.

Types

type Remote

type Remote interface {
	// Authorize handles authentication with third party remote systems,
	// such as github or bitbucket, and returns user data.
	Authorize(w http.ResponseWriter, r *http.Request) (*model.Login, error)

	// GetKind returns the kind of plugin
	GetKind() string

	// GetHost returns the hostname of the remote service.
	GetHost() string

	// GetRepos fetches all repositories that the specified
	// user has access to in the remote system.
	GetRepos(user *model.User) ([]*model.Repo, error)

	// GetScript fetches the build script (.drone.yml) from the remote
	// repository and returns in string format.
	GetScript(user *model.User, repo *model.Repo, hook *model.Hook) ([]byte, error)

	// Activate activates a repository by creating the post-commit hook and
	// adding the SSH deploy key, if applicable.
	Activate(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.
	Deactivate(user *model.User, repo *model.Repo, link string) error

	// ParseHook parses the post-commit hook from the Request body
	// and returns the required data in a standard format.
	ParseHook(r *http.Request) (*model.Hook, error)

	// Registration returns true if open registration is allowed
	OpenRegistration() bool

	// Get token
	GetToken(*model.User) (*model.Token, error)
}

func Lookup

func Lookup(name string) Remote

Lookup gets a plugin by name.

func Registered

func Registered() []Remote

List Registered remote plugins

Directories

Path Synopsis
oauth
Package oauth supports making OAuth2-authenticated HTTP requests.
Package oauth supports making OAuth2-authenticated HTTP requests.

Jump to

Keyboard shortcuts

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