Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Fx = fx.Provide( NewSQLRepo, NewSvc, NewRouter, NewLogin, NewSignup, )
View Source
var FxMigrations = fx.Invoke( RunMigrations, )
Functions ¶
func NewLogin ¶
func NewLogin(ro *Router) chttp.RouteResult
func NewSignup ¶
func NewSignup(ro *Router) chttp.RouteResult
func RunMigrations ¶
Types ¶
type Config ¶
type Config struct { RequiresVerification bool VerificationEmail EmailConfig }
func GetDefaultConfig ¶
func GetDefaultConfig() Config
type Credentials ¶
type Credentials struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"not null"` UpdatedAt time.Time `gorm:"not null"` UserUUID string `gorm:"not null;uniqueIndex"` Email string `gorm:"not null;uniqueIndex"` Verified bool `gorm:"not null;default:false"` VerificationCode uint `gorm:"not null"` }
func (Credentials) TableName ¶
func (Credentials) TableName() string
type EmailConfig ¶
type NewModuleParams ¶
type Repo ¶
type Repo interface { GetCredentialsByEmail(ctx context.Context, email string) (*Credentials, error) AddCredentials(ctx context.Context, c *Credentials) error }
func NewSQLRepo ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(p RouterParams) *Router
func (*Router) HandleLogin ¶
func (ro *Router) HandleLogin(w http.ResponseWriter, r *http.Request)
func (*Router) HandleSignup ¶
func (ro *Router) HandleSignup(w http.ResponseWriter, r *http.Request)
type RouterParams ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.