Documentation ¶
Index ¶
- type Service
- func (service *Service) CreateUser(w http.ResponseWriter, r *http.Request)
- func (service *Service) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (service *Service) GetUserByID(w http.ResponseWriter, r *http.Request)
- func (service *Service) Home(w http.ResponseWriter, r *http.Request)
- func (service *Service) Initialize(DBType, DBUser, DBPassword, DBHost, DBName, APISecret string, DBPort int)
- func (service *Service) Login(w http.ResponseWriter, r *http.Request)
- func (service *Service) Run(addr string)
- func (service *Service) SignIn(email, password string) (string, error)
- func (service *Service) UpdateUser(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
Service global context
func (*Service) CreateUser ¶
func (service *Service) CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser callback funtion curl -i -X POST -H "Content-Type: application/json" -d "{ \"firstname\": \"Jhon\", \"lastname\": \"Donals\", \"email\": \"jd@fake.com\",\"password\": \"1234\"}" http://localhost:8080/user/add
func (*Service) DeleteUser ¶
func (service *Service) DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser handler curl -i -X DELETE http://localhost:8080/user/1
func (*Service) GetUserByID ¶
func (service *Service) GetUserByID(w http.ResponseWriter, r *http.Request)
GetUserByID handler curl -i -X GET http://localhost:8080/user/1
func (*Service) Home ¶
func (service *Service) Home(w http.ResponseWriter, r *http.Request)
Home callback funtion
func (*Service) Initialize ¶
func (service *Service) Initialize(DBType, DBUser, DBPassword, DBHost, DBName, APISecret string, DBPort int)
Initialize Server Database
func (*Service) Login ¶
func (service *Service) Login(w http.ResponseWriter, r *http.Request)
Login handler curl -i -X POST -H "Content-Type: application/json" -d "{ \"email\": \"jd@fake.com\",\"password\": \"1234\"}" http://localhost:8080/login
func (*Service) UpdateUser ¶
func (service *Service) UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser handler curl -i -X POST -H "Content-Type: application/json" -d "{ \"firstname\": \"Jhon\", \"lastname\": \"Donals\", \"email\": \"jd@fakeee.com\",\"password\": \"1234\"}" http://localhost:8080/user/1