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.
29 lines
681 B
Go
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"`
|
|
}
|
|
)
|