server

package
v0.0.0-...-26736ab Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const GHLoginURL string = "https://github.com/login/oauth/authorize"

GHLoginURL is the base GitHub login URL

View Source
const GHRedirectURL string = "http://localhost:5000/api/v0/github/oauth_callback"

GHRedirectURL is the URL users should be redirected to after login

Variables

This section is empty.

Functions

This section is empty.

Types

type GHLoginURLHandler

type GHLoginURLHandler struct {
	// contains filtered or unexported fields
}

GHLoginURLHandler returns the GitHub login URL to send the user to

func (GHLoginURLHandler) ServeHTTP

func (h GHLoginURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

type GHOAuthHandler

type GHOAuthHandler struct {
	// contains filtered or unexported fields
}

GHOAuthHandler exchanges a temporary GitHub code for an OAuth token

func (GHOAuthHandler) ServeHTTP

func (h GHOAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

type GetReposHandler

type GetReposHandler struct {
	// contains filtered or unexported fields
}

GetReposHandler provides a list of GitHub repositories

func (GetReposHandler) ServeHTTP

func (h GetReposHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

type GetTrackedGHReposHandler

type GetTrackedGHReposHandler struct {
	// contains filtered or unexported fields
}

GetTrackedGHReposHandler returns a list of tracked GitHub repositories

func (GetTrackedGHReposHandler) ServeHTTP

ServeHTTP implements http.Handler

type HealthHandler

type HealthHandler struct {
	// contains filtered or unexported fields
}

HealthHandler returns an OK response for external services to verify the server is running

func (HealthHandler) ServeHTTP

func (h HealthHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request)

ServeHTTP implements http.Handler

type JSONResponder

type JSONResponder struct {
	// contains filtered or unexported fields
}

JSONResponder responds to HTTP requests with JSON

func NewJSONResponder

func NewJSONResponder(logger golog.Logger, w http.ResponseWriter) JSONResponder

NewJSONResponder creates a new JSONResponder

func (JSONResponder) Respond

func (r JSONResponder) Respond(status int, v interface{})

RespondJSON responds to an HTTP request with a JSON

type RecoveryHandler

type RecoveryHandler struct {
	// contains filtered or unexported fields
}

RecoveryHandler wraps a http.Handler and recovers from panics

func NewRecoveryHandler

func NewRecoveryHandler(logger golog.Logger,
	rootHandler http.Handler) RecoveryHandler

NewRecoveryHandler creates a new RecoveryHandler

func (RecoveryHandler) ServeHTTP

func (r RecoveryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler.ServeHTTP

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a HTTP server

func NewPrivateServer

func NewPrivateServer(ctx context.Context, logger golog.Logger,
	cfg *config.Config, etcdKV etcd.KeysAPI) Server

NewPrivateServer creates a new server for private API endpoints

func NewPublicServer

func NewPublicServer(ctx context.Context, logger golog.Logger,
	cfg *config.Config, etcdKV etcd.KeysAPI,
	jobRunner *jobs.JobRunner) Server

NewPublicServer creates a new server for public API endpoints

func (Server) Run

func (s Server) Run() error

Run starts the HTTP server

type TrackGHRepoHandler

type TrackGHRepoHandler struct {
	// contains filtered or unexported fields
}

TrackGHRepoHandler marks a GitHub repository to be tracked

func (TrackGHRepoHandler) ServeHTTP

func (h TrackGHRepoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

type UntrackGHRepoHandler

type UntrackGHRepoHandler struct {
	// contains filtered or unexported fields
}

UnrackGHRepoHandler untracks a GitHub repository

func (UntrackGHRepoHandler) ServeHTTP

ServeHTTP implements http.Handler

type WebHookHandler

type WebHookHandler struct {
	// contains filtered or unexported fields
}

WebHookHandler triggers a build and deploy when GitHub sends a web hook request

func (WebHookHandler) ServeHTTP

func (h WebHookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServerHTTP implements http.Handler

Jump to

Keyboard shortcuts

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