Documentation ¶
Index ¶
- Variables
- func AssertEqualTime(t *testing.T, expected, actual time.Time)
- func DetermineReturnToURL(request *url.URL, defaultReturnTo *url.URL, whitelistedDomains []url.URL) (string, error)
- func IsJSONRequest(r *http.Request) bool
- func IsValidNumber(s string) bool
- func IsZeroUUID(id db.UUID) bool
- func MustEncodeJSON(t *testing.T, in interface{}) string
- func MustReadAll(r io.Reader) []byte
- func NewCSRFHandler(router http.Handler, writer herodot.Writer, logger logrus.FieldLogger, ...) *nosurf.CSRFHandler
- func NewTestHTTPRequest(t *testing.T, method, url string, body io.Reader) *http.Request
- func NewUUID() db.UUID
- func ParseUUID(in string) db.UUID
- func RequireEqualTime(t *testing.T, expected, actual time.Time)
- func SessionGetString(r *http.Request, s sessions.Store, id string, key interface{}) (string, error)
- func SessionGetStringOr(r *http.Request, s sessions.Store, id, key, fallback string) string
- func SessionPersistValues(w http.ResponseWriter, r *http.Request, s sessions.Store, id string, ...) error
- func TypeMap(m map[string]string) (map[string]interface{}, error)
- func UntypedMapToJSON(m map[string]string) (json.RawMessage, error)
- type CSRFProvider
- type CookieProvider
- type Ider
- type LoggingProvider
- type RouterAdmin
- type RouterPublic
- type WriterProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyUUID db.UUID
Functions ¶
func DetermineReturnToURL ¶
func IsJSONRequest ¶
func IsValidNumber ¶
IsValidNumber reports whether s is a valid JSON number literal.
Taken from encoding/json
func IsZeroUUID ¶
func MustEncodeJSON ¶
func MustReadAll ¶
func NewCSRFHandler ¶
func NewTestHTTPRequest ¶
func SessionGetString ¶
func SessionGetString(r *http.Request, s sessions.Store, id string, key interface{}) (string, error)
SessionGetString returns a string for the given id and key or an error if the session is invalid, the key does not exist, or the key value is not a string.
func SessionGetStringOr ¶
SessionGetStringOr returns a string for the given id and key or the fallback value if the session is invalid, the key does not exist, or the key value is not a string.
func SessionPersistValues ¶
func SessionPersistValues(w http.ResponseWriter, r *http.Request, s sessions.Store, id string, values map[string]interface{}) error
SessionPersistValues adds values to the session store and persists the changes.
func UntypedMapToJSON ¶
func UntypedMapToJSON(m map[string]string) (json.RawMessage, error)
Types ¶
type CSRFProvider ¶
type CSRFProvider interface {
CSRFHandler() *nosurf.CSRFHandler
}
type CookieProvider ¶
type LoggingProvider ¶
type LoggingProvider interface {
Logger() logrus.FieldLogger
}
type RouterAdmin ¶
type RouterAdmin struct {
*httprouter.Router
}
func NewRouterAdmin ¶
func NewRouterAdmin() *RouterAdmin
type RouterPublic ¶
type RouterPublic struct {
*httprouter.Router
}
func NewRouterPublic ¶
func NewRouterPublic() *RouterPublic
type WriterProvider ¶
Click to show internal directories.
Click to hide internal directories.