server

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RewriteRequest

func RewriteRequest(next http.Handler) http.Handler

Types

type Middleware

type Middleware func(http.Handler) http.Handler

func Chain

func Chain(xs ...Middleware) Middleware

type Server

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

Server contains router and handler methods

func NewServer

func NewServer(logger *slog.Logger, config *appconfig.AppConfig) *Server

NewServer creates a new server object and builds router

func (*Server) AuthCallbackHandler

func (s *Server) AuthCallbackHandler(w http.ResponseWriter, r *http.Request)

AuthCallbackHandler Handles auth callback request

func (*Server) GetUserFromCookie

func (s *Server) GetUserFromCookie(r *http.Request) (*string, error)

func (*Server) Logging

func (s *Server) Logging(next http.Handler) http.Handler

func (*Server) LoginHandler

func (s *Server) LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler logs a user in

func (*Server) LogoutHandler

func (s *Server) LogoutHandler(w http.ResponseWriter, r *http.Request)

LogoutHandler logs a user out

func (*Server) Start

func (s *Server) Start()

Jump to

Keyboard shortcuts

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