web

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 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 GoGetHandler

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

GoGetHandler handles go get requests.

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, logger *log.Logger) 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 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