web

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidHeader = errors.New("invalid authorization header")

ErrInvalidHeader is returned when the authorization header is invalid.

View Source
var ErrInvalidPassword = errors.New("invalid password")

ErrInvalidPassword is returned when the password is invalid.

View Source
var ErrInvalidToken = errors.New("invalid token")

ErrInvalidToken is returned when a token is invalid.

Functions

func GitController

func GitController(_ context.Context, r *mux.Router)

GitController is a router for git services.

func NewContextHandler

func NewContextHandler(ctx context.Context) func(http.Handler) http.Handler

NewContextHandler returns a new context middleware. This middleware adds the config, backend, and logger to the request context.

func NewLoggingMiddleware

func NewLoggingMiddleware(next http.Handler) http.Handler

NewLoggingMiddleware returns a new logging middleware.

func NewRouter

func NewRouter(ctx context.Context) http.Handler

NewRouter returns a new HTTP router.

Types

type GitRoute

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

GitRoute is a route for git services.

func (GitRoute) ServeHTTP

func (g GitRoute) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type GoGetHandler

type GoGetHandler struct{}

GoGetHandler handles go get requests.

func (GoGetHandler) ServeHTTP

func (g GoGetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HTTPServer

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

HTTPServer is an http server.

func NewHTTPServer

func NewHTTPServer(ctx context.Context) (*HTTPServer, error)

NewHTTPServer creates a new HTTP server.

func (*HTTPServer) Close

func (s *HTTPServer) Close() error

Close closes the HTTP server.

func (*HTTPServer) ListenAndServe

func (s *HTTPServer) ListenAndServe() error

ListenAndServe starts the HTTP server.

func (*HTTPServer) Shutdown

func (s *HTTPServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the HTTP server.

Jump to

Keyboard shortcuts

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