server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2015 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultOptions = Options{}

	// DefaultGitHubScopes is the default oauth scopes to obtain when getting an
	// authorization from GitHub.
	DefaultGitHubScopes = []string{
		"repo_deployment",
		"read:org",
	}
)

Functions

func New

func New(e *empire.Empire, options Options) http.Handler

func NewAuthorizer

func NewAuthorizer(clientID, clientSecret, organization string) authorization.Authorizer

NewAuthorizer returns a new Authorizer. If the client id is present, it will return a real Authorizer that talks to GitHub. If an empty string is provided, then it will just return a fake authorizer.

Types

type HealthHandler

type HealthHandler struct {
	// A function that returns true if empire is healthy.
	IsHealthy func() bool
}

HealthHandler is an http.Handler that returns the health of empire.

func NewHealthHandler

func NewHealthHandler(e *empire.Empire) *HealthHandler

NewHealthHandler returns a new HealthHandler using the IsHealthy method from an Empire instance.

func (*HealthHandler) ServeHTTPContext

func (h *HealthHandler) ServeHTTPContext(_ context.Context, w http.ResponseWriter, r *http.Request) error

type Options

type Options struct {
	GitHub struct {
		ClientID     string
		ClientSecret string
		Organization string
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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