Documentation ¶
Index ¶
Constants ¶
View Source
const ( JWTIssuer = "github.com/nafutliikay/golang-webapp" JWTExpiry = 30 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfigAutoMigrate ¶
type AppConfigAutoMigrate bool
type AppConfigEnv ¶
type AppConfigEnv string
type AppConfigImpl ¶
type AppConfigImpl struct {
// contains filtered or unexported fields
}
AppConfigImpl Implementation of the interfaces.AppConfig interface for application configuration.
func NewAppConfig ¶
func NewAppConfig(autoMigrate AppConfigAutoMigrate, env AppConfigEnv, listen interfaces.ListenConfig, mysql interfaces.MySQLConfig) *AppConfigImpl
func (AppConfigImpl) AutoMigrate ¶
func (a AppConfigImpl) AutoMigrate() bool
func (AppConfigImpl) Env ¶
func (a AppConfigImpl) Env() string
func (AppConfigImpl) Listen ¶
func (a AppConfigImpl) Listen() interfaces.ListenConfig
func (AppConfigImpl) MySQL ¶
func (a AppConfigImpl) MySQL() interfaces.MySQLConfig
type AppDaosImpl ¶
type AppDaosImpl struct {
// contains filtered or unexported fields
}
AppDaosImpl Implementation of the interfaces.AppDaos interface for exposing DAOs to the application.
func NewAppDaos ¶
func NewAppDaos(users interfaces.UserDao) *AppDaosImpl
func (AppDaosImpl) Users ¶
func (a AppDaosImpl) Users() interfaces.UserDao
type AppDaosParams ¶
type AppDaosParams struct{}
type AppImpl ¶
type AppImpl struct {
// contains filtered or unexported fields
}
AppImpl Implementation of the interfaces.App for single point of entry to application.
func NewApp ¶
func NewApp(cfg interfaces.AppConfig, db *gorm.DB, daos interfaces.AppDaos, svcs interfaces.AppServices, router *mux.Router, appLogger types.AppLogger, rootLogger types.RootLogger) *AppImpl
func (AppImpl) Config ¶
func (a AppImpl) Config() interfaces.AppConfig
func (AppImpl) Dao ¶
func (a AppImpl) Dao() interfaces.AppDaos
func (AppImpl) RootLogger ¶
func (AppImpl) Service ¶
func (a AppImpl) Service() interfaces.AppServices
type AppServicesImpl ¶
type AppServicesImpl struct {
// contains filtered or unexported fields
}
AppServicesImpl Implementation of the interfaces.AppServices interface for exposing services to the application.
func NewAppServices ¶
func NewAppServices(jwt interfaces.JWTService, login interfaces.LoginService) *AppServicesImpl
func (AppServicesImpl) JWT ¶
func (a AppServicesImpl) JWT() interfaces.JWTService
func (AppServicesImpl) Login ¶
func (a AppServicesImpl) Login() interfaces.LoginService
type AppServicesParams ¶
type AppServicesParams struct{}
type JWTServiceImpl ¶
type JWTServiceImpl struct {
// contains filtered or unexported fields
}
func NewJWTService ¶
func NewJWTService(key types.JWTKey, logger types.JWTServiceLogger) (*JWTServiceImpl, error)
func (JWTServiceImpl) Generate ¶
func (j JWTServiceImpl) Generate(user *models.User) (interfaces.JWTGenerateResult, error)
func (JWTServiceImpl) Validate ¶
func (j JWTServiceImpl) Validate(encodedToken string) (interfaces.JWTValidateResult, error)
type LoginServiceImpl ¶
type LoginServiceImpl struct {
// contains filtered or unexported fields
}
func NewLoginService ¶
func NewLoginService(dao interfaces.UserDao, jwt interfaces.JWTService, logger types.LoginServiceLogger) *LoginServiceImpl
func (LoginServiceImpl) Login ¶
func (l LoginServiceImpl) Login(email, password string) (*interfaces.LoginResult, error)
Click to show internal directories.
Click to hide internal directories.