PromucFlow_constructor/app/server/models/user.go
Arpit Mohan 1133b53437 Adding Google authentication via Goth. All endpoints can now be authenticated.
Other changes include:
* Also removing httprouter mux in favour of gorilla for being more mature and having more integrations and resources available for debugging.
* Adding http middlewares for logging req processing time and handling authentication.

TODO: Need to add context in the middleware as well. Will be useful for logging and debugging.
2019-03-16 15:47:47 +05:30

29 lines
681 B
Go

package models
import (
"time"
"github.com/markbates/goth"
)
type (
User struct {
ID int64 `json:"id,omitempty" sql:"id"`
CreatedAt time.Time `json:"created_at,omitempty" sql:"created_at"`
UpdatedAt time.Time `json:"updated_at,omitempty" sql:"updated_at"`
Username string `json:"username" sql:"username"`
Email string `json:"email" sql:"email"`
GothUser goth.User `json:"gothUser,omitempty"`
}
Role struct {
ID int64 `json:"id,omitempty" sql:"id"`
CreatedAt time.Time `json:"created_at,omitempty" sql:"created_at"`
UpdatedAt time.Time `json:"updated_at,omitempty" sql:"updated_at"`
Name string `json:"name" sql:"name"`
}
)