server

package
v0.0.0-...-78b6be4 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

type ContextKey

type ContextKey string
var UsernameKey ContextKey = "usernameKey"

type ErrorData

type ErrorData struct {
	ErrorHeader  string
	ErrorMessage string
}

type FilesData

type FilesData struct {
	UserFiles []models.File
}

type LoginErrors

type LoginErrors struct {
	Username string
	Password string
}

type RegistrationErrors

type RegistrationErrors struct {
	Username        string
	Password        string
	RegistrationKey string
}

type Server

type Server struct {
	Config *config.Config
	// contains filtered or unexported fields
}

func New

func New(c *config.Config) *Server

func (*Server) E400

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

func (*Server) E404

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

func (*Server) E500

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

func (*Server) FileDelete

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

func (*Server) FileUpdate

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

func (*Server) FilesGet

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

func (*Server) GetValidJWTUsername

func (s *Server) GetValidJWTUsername(c *http.Cookie, ctx context.Context) string

func (*Server) ListenAndServe

func (server *Server) ListenAndServe()

func (*Server) LoginGet

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

func (*Server) LoginPost

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

func (*Server) ParseTemplates

func (server *Server) ParseTemplates()

func (*Server) RegisterGet

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

func (*Server) RegisterPost

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

func (*Server) SetupRoutes

func (s *Server) SetupRoutes()

func (*Server) UploadGet

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

func (*Server) UploadPost

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

func (*Server) ValidateJwt

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

func (*Server) ViewFile

func (server *Server) ViewFile(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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