Documentation ¶
Overview ¶
Package appcontext provides functionality to pass data in contexts through the lifetime of a web request.
Index ¶
- func ContextWithData(ctx context.Context, appData Data) context.Context
- func ContextWithSession(ctx context.Context, data *Session) context.Context
- type Data
- func (d Data) EncodeQuery() string
- func (d Data) IsAdmin() bool
- func (d Data) IsAttorneyType() bool
- func (d Data) IsCertificateProvider() bool
- func (d Data) IsDonor() bool
- func (d Data) IsReplacementAttorney() bool
- func (d Data) IsTrustCorporation() bool
- func (d Data) Redirect(w http.ResponseWriter, r *http.Request, url string) error
- type Localizer
- type Session
- type SessionMissingError
- type SupporterData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithData ¶ added in v0.1339.0
Types ¶
type Data ¶ added in v0.1339.0
type Data struct { Page string Path string Query url.Values Localizer Localizer Lang localize.Lang CookieConsentSet bool CanGoBack bool CanToggleWelsh bool SessionID string LpaID string CsrfToken string ActorType actor.Type AttorneyUID actoruid.UID LoginSessionEmail string SupporterData *SupporterData }
func DataFromContext ¶ added in v0.1339.0
func (Data) EncodeQuery ¶ added in v0.1339.0
func (Data) IsAttorneyType ¶ added in v0.1339.0
func (Data) IsCertificateProvider ¶ added in v0.1339.0
func (Data) IsReplacementAttorney ¶ added in v0.1339.0
func (Data) IsTrustCorporation ¶ added in v0.1339.0
type Localizer ¶ added in v0.1339.0
type Localizer interface { Concat(list []string, joiner string) string Count(messageID string, count int) string Format(messageID string, data map[string]interface{}) string FormatCount(messageID string, count int, data map[string]any) string FormatDate(t date.TimeOrDate) string FormatTime(t time.Time) string FormatDateTime(t time.Time) string Possessive(s string) string SetShowTranslationKeys(s bool) ShowTranslationKeys() bool T(messageID string) string }
type Session ¶ added in v0.1339.0
type SessionMissingError ¶
type SessionMissingError struct{}
func (SessionMissingError) Error ¶
func (s SessionMissingError) Error() string
type SupporterData ¶ added in v0.1339.0
type SupporterData struct { LpaType lpadata.LpaType DonorFullName string OrganisationName string IsManageOrganisation bool Permission supporterdata.Permission LoggedInSupporterID string }
Click to show internal directories.
Click to hide internal directories.