stats

package
v0.44.32 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

The very app statistics routes and controllers logic package for the backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStatRouter added in v0.44.24

func NewStatRouter(statController *StatController) chi.Router

func NewStatService added in v0.44.24

func NewStatService(
	pollRepository models.PollRepositoryInterface,
	postRepository models.PostRepositoryInterface,
	userRepository models.UserRepositoryInterface,
) models.StatServiceInterface

Types

type StatController added in v0.44.24

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

func NewStatController added in v0.44.24

func NewStatController(statService models.StatServiceInterface) *StatController

func (*StatController) GetAll added in v0.44.24

func (c *StatController) GetAll(w http.ResponseWriter, r *http.Request)

GetAll acts like a handler for stats page.

@Summary Get stats @Description get stats @Tags stats @Produce json @Success 200 {object} common.APIResponse{data=stats.GetAll.responseData} @Failure 400 {object} common.APIResponse @Failure 401 {object} common.APIResponse{data=auth.Auth.responseData} @Router /stats [get]

type StatService added in v0.44.24

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

func (*StatService) Calculate added in v0.44.24

func (s *StatService) Calculate(ctx context.Context) (*map[string]int64, *map[string]models.UserStat, *map[string]models.User, error)

Jump to

Keyboard shortcuts

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