server

package
v0.0.0-...-3f1e87a Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomUserResponse

func CustomUserResponse(user db.User) userResp

CustomUserResponse returns a UserResp object ready to be sent as a Response

Types

type CreateUserRequest

type CreateUserRequest struct {
	Firstname   string `json:"firstname" binding:"required"`
	Lastname    string `json:"lastname" binding:"required"`
	Username    string `json:"username" binding:"required,alphanum"`
	Password    string `json:"password" binding:"required,min=8"`
	Email       string `json:"email" binding:"required,email"`
	PhoneNumber string `json:"phone_number" binding:"required"`
}

CreateUserRequest model for http post request body

type Server

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

func NewServer

func NewServer(store db.Store) (*Server, error)

NewServer creates a new http server, sets up api routes returns the server instance, or an error on error

func (*Server) Start

func (server *Server) Start(address string) error

Start: runs the HTTP server on a specific address

Jump to

Keyboard shortcuts

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