handlers

package
v0.0.0-...-5a726a0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package classification of Account API

Documentation for Account API

Schemes: http
BasePath: /
Version: 1.0.0

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

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

Accounts handler for getting, creating and updating accounts

func NewAccounts

func NewAccounts(logger *log.Logger, db *gorm.DB, validator *internal.Validation) *Accounts

NewAccounts returns a new accounts handler with the given logger

func (*Accounts) ListSingle

func (a *Accounts) ListSingle(rw http.ResponseWriter, r *http.Request)

ListSingle handles get requests and returns single account by id

func (*Accounts) Login

func (a *Accounts) Login(rw http.ResponseWriter, r *http.Request)

Login lets the user login with a valid json structure defined in the credentials struct

func (*Accounts) MiddlewareValidateAccount

func (a *Accounts) MiddlewareValidateAccount(next http.Handler) http.Handler

MiddlewareValidateAccount checks wether the input is a valid json formatted account. When it is it will pass the next http handler

func (*Accounts) MiddlewareValidateToken

func (a *Accounts) MiddlewareValidateToken(next http.Handler) http.Handler

MiddlewareValidateToken validates if the jwt in the cookie is valid

func (*Accounts) Refresh

func (a *Accounts) Refresh(rw http.ResponseWriter, r *http.Request)

Refresh allows the user to get a new refreshed token

func (*Accounts) Register

func (a *Accounts) Register(rw http.ResponseWriter, r *http.Request)

Register a account with a valid json structure

type KeyAccount

type KeyAccount struct{}

KeyAccount for serialization/deserialization

Jump to

Keyboard shortcuts

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