Documentation
¶
Index ¶
- Variables
- func CalculateAge(t time.Time) int
- func NewHttpServer(conf Conf, db *database.Queries, signingKey mjwt.Signer) *http.Server
- func ParseClaims(claims string) map[string]bool
- func PrepareRedirectUrl(targetPath string, origin *url.URL) *url.URL
- type Conf
- type HttpServer
- func (h *HttpServer) DbTx(rw http.ResponseWriter, action func(tx *database.Queries) error) bool
- func (h *HttpServer) DbTxError(action func(tx *database.Queries) error) error
- func (h *HttpServer) EditGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) EditOtpPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) EditPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) Home(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) LoginGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, ...)
- func (h *HttpServer) LoginOtpGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) LoginOtpPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) LoginPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, ...)
- func (h *HttpServer) LoginResetPasswordPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params)
- func (h *HttpServer) MailDelete(rw http.ResponseWriter, req *http.Request, params httprouter.Params)
- func (h *HttpServer) MailPassword(rw http.ResponseWriter, _ *http.Request, params httprouter.Params)
- func (h *HttpServer) MailPasswordPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params)
- func (h *HttpServer) MailVerify(rw http.ResponseWriter, req *http.Request, params httprouter.Params)
- func (h *HttpServer) ManageAppsCreateGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) ManageAppsGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) ManageAppsPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) ManageUsersCreateGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) ManageUsersGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) ManageUsersPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
- func (h *HttpServer) OptionalAuthentication(flowPart bool, next UserHandler) httprouter.Handle
- func (h *HttpServer) RequireAdminAuthentication(next UserHandler) httprouter.Handle
- func (h *HttpServer) RequireAuthentication(next UserHandler) httprouter.Handle
- func (h *HttpServer) SafeRedirect(rw http.ResponseWriter, req *http.Request)
- type IdTokenClaims
- type JWTAccessGenerate
- type UserAuth
- type UserHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAuthHttpError = errors.New("auth http error")
View Source
var ErrDatabaseActionFailed = errors.New("database action failed")
Functions ¶
func CalculateAge ¶
func NewHttpServer ¶
func ParseClaims ¶
Types ¶
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func (*HttpServer) DbTx ¶
func (h *HttpServer) DbTx(rw http.ResponseWriter, action func(tx *database.Queries) error) bool
DbTx wraps a database transaction with http error messages and a simple action function. If the action function returns an error the transaction will be rolled back. If there is no error then the transaction is committed.
func (*HttpServer) DbTxError ¶
func (h *HttpServer) DbTxError(action func(tx *database.Queries) error) error
func (*HttpServer) EditGet ¶
func (h *HttpServer) EditGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) EditOtpPost ¶
func (h *HttpServer) EditOtpPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) EditPost ¶
func (h *HttpServer) EditPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) Home ¶
func (h *HttpServer) Home(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) LoginGet ¶
func (h *HttpServer) LoginGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, userAuth UserAuth)
func (*HttpServer) LoginOtpGet ¶
func (h *HttpServer) LoginOtpGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) LoginOtpPost ¶
func (h *HttpServer) LoginOtpPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) LoginPost ¶
func (h *HttpServer) LoginPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, userAuth UserAuth)
func (*HttpServer) LoginResetPasswordPost ¶
func (h *HttpServer) LoginResetPasswordPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params)
func (*HttpServer) MailDelete ¶
func (h *HttpServer) MailDelete(rw http.ResponseWriter, req *http.Request, params httprouter.Params)
func (*HttpServer) MailPassword ¶
func (h *HttpServer) MailPassword(rw http.ResponseWriter, _ *http.Request, params httprouter.Params)
func (*HttpServer) MailPasswordPost ¶
func (h *HttpServer) MailPasswordPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params)
func (*HttpServer) MailVerify ¶
func (h *HttpServer) MailVerify(rw http.ResponseWriter, req *http.Request, params httprouter.Params)
func (*HttpServer) ManageAppsCreateGet ¶
func (h *HttpServer) ManageAppsCreateGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) ManageAppsGet ¶
func (h *HttpServer) ManageAppsGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) ManageAppsPost ¶
func (h *HttpServer) ManageAppsPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) ManageUsersCreateGet ¶
func (h *HttpServer) ManageUsersCreateGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) ManageUsersGet ¶
func (h *HttpServer) ManageUsersGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) ManageUsersPost ¶
func (h *HttpServer) ManageUsersPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth)
func (*HttpServer) OptionalAuthentication ¶
func (h *HttpServer) OptionalAuthentication(flowPart bool, next UserHandler) httprouter.Handle
func (*HttpServer) RequireAdminAuthentication ¶
func (h *HttpServer) RequireAdminAuthentication(next UserHandler) httprouter.Handle
func (*HttpServer) RequireAuthentication ¶
func (h *HttpServer) RequireAuthentication(next UserHandler) httprouter.Handle
func (*HttpServer) SafeRedirect ¶
func (h *HttpServer) SafeRedirect(rw http.ResponseWriter, req *http.Request)
type IdTokenClaims ¶
type IdTokenClaims struct{}
IdTokenClaims contains the JWT claims for an access token
func (IdTokenClaims) Type ¶
func (a IdTokenClaims) Type() string
func (IdTokenClaims) Valid ¶
func (a IdTokenClaims) Valid() error
type JWTAccessGenerate ¶
type JWTAccessGenerate struct {
// contains filtered or unexported fields
}
func NewJWTAccessGenerate ¶
func NewJWTAccessGenerate(signer mjwt.Signer) *JWTAccessGenerate
type UserHandler ¶
type UserHandler func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, auth UserAuth)
Click to show internal directories.
Click to hide internal directories.