user

package
v0.0.0-...-72c0d7f Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(queries *db.Queries) *Service

func (*Service) PublicRoutes

func (s *Service) PublicRoutes(r chi.Router)

func (*Service) UserRoutes

func (s *Service) UserRoutes(r chi.Router)

type User

type User struct {
	Id       int64  `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
	IsAdmin  bool   `json:"is_admin"`
	HasImg   bool   `json:"has_img"`
}

type UserCreation

type UserCreation struct {
	Username string `json:"username" validate:"required,gte=2,lte=24,alphanum"`
	Password string `json:"password" validate:"required,gte=4,lte=128"`
	Email    string `json:"email"    validate:"required,gte=0,lte=128,email"`
}

type UserDetails

type UserDetails struct {
	Id       int64             `json:"id"`
	Username string            `json:"username"`
	Email    string            `json:"email"`
	IsAdmin  bool              `json:"is_admin"`
	Stories  []story.StoryCard `json:"stories"`
	HasImg   bool              `json:"has_img"`
}

Jump to

Keyboard shortcuts

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