Documentation
¶
Index ¶
- type Config
- type Errors
- type Service
- func (s *Service) MethodNotAllowed() http.HandlerFunc
- func (s *Service) NotFound() http.HandlerFunc
- func (s *Service) WithBodyLimit(bytes int64) func(http.Handler) http.Handler
- func (s *Service) WithRateLimit(limiter ratelimit.Limiter) func(http.Handler) http.Handler
- func (s *Service) WithRequestID(h http.Handler) http.Handler
- func (s *Service) WithRequestTime(h http.Handler) http.Handler
- type UserConfig
- type UserConfirmationToken
- type UserErrors
- type UserPasswordResetToken
- type UserService
- func (s *UserService) Create(limiter ratelimit.Limiter) http.HandlerFunc
- func (s *UserService) CreateConfirmationToken(mail UserTokenMail, limiter ratelimit.Limiter) http.HandlerFunc
- func (s *UserService) CreatePasswordResetToken(mail UserTokenMail, limiter ratelimit.Limiter) http.HandlerFunc
- func (s *UserService) CreateSessionToken(ipLimiter ratelimit.Limiter, emailLimiter ratelimit.Limiter) http.HandlerFunc
- func (s *UserService) CreateSudoToken(mail UserTokenMail, limiter ratelimit.Limiter) http.HandlerFunc
- func (s *UserService) Delete() http.HandlerFunc
- func (s *UserService) EditEmail() http.HandlerFunc
- func (s *UserService) EditName() http.HandlerFunc
- func (s *UserService) EditPassword() http.HandlerFunc
- func (s *UserService) Get() http.HandlerFunc
- func (s *UserService) ResetPassword(limiter ratelimit.Limiter) http.HandlerFunc
- func (s *UserService) WithSession(svc jwt.Service[UserSessionToken], limiter ratelimit.Limiter) func(http.Handler) http.Handler
- type UserSessionToken
- type UserTokenMail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Errors ¶
type Errors struct { Internal string `yaml:"internal"` NotFound string `yaml:"notFound"` MethodNotAllowed string `yaml:"methodNotAllowed"` BodyLimitExceeded string `yaml:"bodyLimitExceeded"` BodyMalformed string `yaml:"bodyMalformed"` BadBodyEncoding string `yaml:"badBodyEncoding"` TooManyRequests string `yaml:"tooManyRequests"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) MethodNotAllowed ¶
func (s *Service) MethodNotAllowed() http.HandlerFunc
func (*Service) NotFound ¶
func (s *Service) NotFound() http.HandlerFunc
func (*Service) WithBodyLimit ¶
func (*Service) WithRateLimit ¶
type UserConfig ¶
type UserConfig struct { Errors UserErrors Root *Service DB postgres.UserService Mail smtp.Service ConfirmationToken jwt.Service[UserConfirmationToken] SessionToken jwt.Service[UserSessionToken] SudoToken jwt.Service[UserSessionToken] PasswordResetToken jwt.Service[UserPasswordResetToken] Password argon2id.Service NameValidation validation.Service[string] EmailValidation validation.Service[string] PasswordValidation validation.Service[[]byte] }
type UserConfirmationToken ¶
type UserConfirmationToken struct {
Email string `json:"email"`
}
type UserErrors ¶
type UserErrors struct { BadName string `yaml:"badName"` BadEmail string `yaml:"badEmail"` BadPassword string `yaml:"badPassword"` BadPasswordEncoding string `yaml:"badPasswordEncoding"` BadToken string `yaml:"badToken"` BadSession string `yaml:"badSession"` MissingSession string `yaml:"missingSession"` InvalidCredentials string `yaml:"invalidCredentials"` InvalidPassword string `yaml:"invalidPassword"` NotFound string `yaml:"notFound"` AlreadyExists string `yaml:"alreadyExists"` }
type UserPasswordResetToken ¶
type UserPasswordResetToken struct {
Id int64 `json:"id"`
}
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(cfg *UserConfig) *UserService
func (*UserService) Create ¶
func (s *UserService) Create(limiter ratelimit.Limiter) http.HandlerFunc
func (*UserService) CreateConfirmationToken ¶
func (s *UserService) CreateConfirmationToken(mail UserTokenMail, limiter ratelimit.Limiter) http.HandlerFunc
func (*UserService) CreatePasswordResetToken ¶
func (s *UserService) CreatePasswordResetToken(mail UserTokenMail, limiter ratelimit.Limiter) http.HandlerFunc
func (*UserService) CreateSessionToken ¶
func (s *UserService) CreateSessionToken(ipLimiter ratelimit.Limiter, emailLimiter ratelimit.Limiter) http.HandlerFunc
func (*UserService) CreateSudoToken ¶
func (s *UserService) CreateSudoToken(mail UserTokenMail, limiter ratelimit.Limiter) http.HandlerFunc
func (*UserService) Delete ¶
func (s *UserService) Delete() http.HandlerFunc
func (*UserService) EditEmail ¶
func (s *UserService) EditEmail() http.HandlerFunc
func (*UserService) EditName ¶
func (s *UserService) EditName() http.HandlerFunc
func (*UserService) EditPassword ¶
func (s *UserService) EditPassword() http.HandlerFunc
func (*UserService) Get ¶
func (s *UserService) Get() http.HandlerFunc
func (*UserService) ResetPassword ¶
func (s *UserService) ResetPassword(limiter ratelimit.Limiter) http.HandlerFunc
func (*UserService) WithSession ¶
func (s *UserService) WithSession(svc jwt.Service[UserSessionToken], limiter ratelimit.Limiter) func(http.Handler) http.Handler
type UserSessionToken ¶
type UserSessionToken struct {
Id int64 `json:"id"`
}
type UserTokenMail ¶
Click to show internal directories.
Click to hide internal directories.