Documentation ¶
Index ¶
- Constants
- func GetCandidateRecord(r *http.Request) *models.CandidateRecord
- func GetDataset(r *http.Request) *models.Dataset
- func GetPublication(r *http.Request) *models.Publication
- func RequireCurator(next http.Handler) http.Handler
- func RequireEditCandidateRecord(repo *repositories.Repo) func(http.Handler) http.Handler
- func RequireEditDataset(repo *repositories.Repo) func(http.Handler) http.Handler
- func RequireEditPublication(repo *repositories.Repo) func(http.Handler) http.Handler
- func RequireUser(next http.Handler) http.Handler
- func RequireViewCandidateRecord(repo *repositories.Repo) func(http.Handler) http.Handler
- func RequireViewDataset(repo *repositories.Repo) func(http.Handler) http.Handler
- func RequireViewPublication(repo *repositories.Repo) func(http.Handler) http.Handler
- func Set(config Config) func(http.Handler) http.Handler
- func SetCandidateRecord(repo *repositories.Repo) func(http.Handler) http.Handler
- func SetDataset(repo *repositories.Repo) func(http.Handler) http.Handler
- func SetNav(nav string) func(http.Handler) http.Handler
- func SetPublication(repo *repositories.Repo) func(http.Handler) http.Handler
- func SetSubNav(subNav string) func(http.Handler) http.Handler
- type Config
- type Ctx
- func (c *Ctx) AssetPath(asset string) string
- func (c *Ctx) FlagCandidateRecords() bool
- func (c *Ctx) HandleError(w http.ResponseWriter, r *http.Request, err error)
- func (c *Ctx) PathTo(name string, pairs ...any) *url.URL
- func (c *Ctx) PersistFlash(w http.ResponseWriter, f flash.Flash)
- func (c *Ctx) URLTo(name string, pairs ...any) *url.URL
Constants ¶
View Source
const ( UserIDKey = "user_id" OriginalUserIDKey = "original_user_id" UserRoleKey = "user_role" OriginalUserRoleKey = "original_user_role" DestinationKey = "destination" FlashCookiePrefix = "flash" )
View Source
const CandidateRecordKey = contextKey("publication")
View Source
const DatasetKey = contextKey("dataset")
View Source
const PublicationKey = contextKey("publication")
Variables ¶
This section is empty.
Functions ¶
func GetCandidateRecord ¶ added in v1.0.59
func GetCandidateRecord(r *http.Request) *models.CandidateRecord
func GetPublication ¶ added in v1.0.56
func GetPublication(r *http.Request) *models.Publication
func RequireEditCandidateRecord ¶ added in v1.0.59
func RequireEditDataset ¶ added in v1.0.56
func RequireEditPublication ¶ added in v1.0.56
func RequireViewCandidateRecord ¶ added in v1.0.59
func RequireViewDataset ¶ added in v1.0.56
func RequireViewPublication ¶ added in v1.0.56
func SetCandidateRecord ¶ added in v1.0.59
func SetDataset ¶ added in v1.0.56
func SetPublication ¶ added in v1.0.56
Types ¶
type Config ¶
type Config struct { *backends.Services Logger *slog.Logger Router *ich.Mux Assets map[string]string MaxFileSize int Timezone *time.Location Loc *gotext.Locale Env string StatusErrorHandlers map[int]http.HandlerFunc ErrorHandlers map[error]http.HandlerFunc SessionName string SessionStore sessions.Store BaseURL *url.URL FrontendURL string CSRFName string }
type Ctx ¶
type Ctx struct { Config Log *slog.Logger Loc *gotext.Locale User *models.Person UserRole string OriginalUser *models.Person ProxiedPerson *models.Person Flash []flash.Flash CSRFToken string CSPNonce string CurrentURL *url.URL // contains filtered or unexported fields }
func (*Ctx) FlagCandidateRecords ¶ added in v1.0.56
TODO temporary flag implementation
func (*Ctx) HandleError ¶
func (*Ctx) PersistFlash ¶
func (c *Ctx) PersistFlash(w http.ResponseWriter, f flash.Flash)
Click to show internal directories.
Click to hide internal directories.