Documentation ¶
Index ¶
- func SessionGenerate() (string, time.Time)
- func SetCookie(w http.ResponseWriter, name, value string)
- func TokenGenerate(user entity.User, sessionID int, secret string) string
- type Auth
- type AuthService
- type Ctx
- type JWT
- type JWTService
- type News
- type NewsService
- type Service
- type Session
- type TokenJWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SessionGenerate ¶
func SetCookie ¶
func SetCookie(w http.ResponseWriter, name, value string)
Types ¶
type Auth ¶
type Auth interface { Register(http.ResponseWriter, *http.Request) Login(http.ResponseWriter, *http.Request) }
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuth ¶
func NewAuth(repo repository.Auth, sectret string) *AuthService
func (*AuthService) Login ¶
func (s *AuthService) Login(w http.ResponseWriter, r *http.Request)
func (*AuthService) Register ¶
func (s *AuthService) Register(w http.ResponseWriter, r *http.Request)
type JWT ¶
type JWT interface { Logout(http.ResponseWriter, *http.Request) RefreshJWT(http.ResponseWriter, *http.Request) }
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func NewJWT ¶
func NewJWT(repo repository.JWT, sectret string) *JWTService
func (*JWTService) Logout ¶
func (s *JWTService) Logout(w http.ResponseWriter, r *http.Request)
func (*JWTService) RefreshJWT ¶
func (s *JWTService) RefreshJWT(w http.ResponseWriter, r *http.Request)
type News ¶
type News interface { CreateNews(http.ResponseWriter, *http.Request) DeleteNews(http.ResponseWriter, *http.Request) }
type NewsService ¶
type NewsService struct {
// contains filtered or unexported fields
}
func NewNews ¶
func NewNews(repo repository.News) *NewsService
func (*NewsService) CreateNews ¶
func (s *NewsService) CreateNews(w http.ResponseWriter, r *http.Request)
func (*NewsService) DeleteNews ¶
func (s *NewsService) DeleteNews(w http.ResponseWriter, r *http.Request)
type Service ¶
func NewSer ¶
func NewSer(rep *repository.Repository, ctx *Ctx) *Service
Click to show internal directories.
Click to hide internal directories.