account

package
v0.0.0-...-4f87603 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_AVATAR_SIZE int64 = 1 << 20

Maximum avatar size that can be uploaded by a user. Current value is set to 1 MiB

View Source
const PERSIST_SESSION_TIME int = 604800

Time in seconds after which user has to log in manually again. Value set to 7 days.

View Source
const SESSION_TIME int = 5

Time in seconds after which session times out.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountHandler

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

func NewHandler

func NewHandler(db *pgxpool.Pool, sessions *redis.Client) *AccountHandler

func (*AccountHandler) AcceptFriendRequest

func (acc *AccountHandler) AcceptFriendRequest() http.HandlerFunc

func (*AccountHandler) Auth

func (*AccountHandler) GetUserByUsername

func (acc *AccountHandler) GetUserByUsername() http.HandlerFunc

func (*AccountHandler) Login

func (acc *AccountHandler) Login() http.HandlerFunc

func (*AccountHandler) Register

func (acc *AccountHandler) Register() http.HandlerFunc

Handles user registration. Validates values given in request body, then hashes password and inserts user into database. TODO: Email code verification

func (*AccountHandler) SendFriendRequest

func (acc *AccountHandler) SendFriendRequest() http.HandlerFunc

func (*AccountHandler) UploadAvatar

func (acc *AccountHandler) UploadAvatar() http.HandlerFunc

TODO: S3 upload

type ContextKey

type ContextKey string
const SessionKey ContextKey = "session"

Jump to

Keyboard shortcuts

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