account

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package account lets a logged-in user manage their own profile photo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

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

Handlers serves /account.

func NewHandlers

func NewHandlers(svc *Service, files *upload.Files) *Handlers

func (*Handlers) Register

func (h *Handlers) Register(g *echo.Group, guards web.Guards)

Register mounts the account routes on the /api/v1 group.

type Service

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

Service changes the current user's photo.

func NewService

func NewService(store Store, files *upload.Files) *Service

func (*Service) RemoveImage

func (s *Service) RemoveImage(ctx context.Context, u user.User) (user.User, error)

RemoveImage clears u's photo.

func (*Service) SetImage

func (s *Service) SetImage(ctx context.Context, u user.User, image *upload.File) (user.User, error)

SetImage replaces u's photo; the old object is deleted after the DB write.

type Store

type Store interface {
	EditUserImage(ctx context.Context, userParam user.User) error
}

Store updates a user's photo (satisfied by *user.Store).

Jump to

Keyboard shortcuts

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