Documentation
¶
Index ¶
- Constants
- func Decode(hash string) ([]byte, error)
- func Generate(keysize int) string
- func JSONResponse(w http.ResponseWriter, o interface{})
- func JSONStatusResponse(code int, w http.ResponseWriter, o interface{})
- func QueryParamKeys(v url.Values) []string
- func Redirect(w http.ResponseWriter, r *http.Request, targetURL string, ...)
- type DebugMiddleware
- type Seeder
Constants ¶
View Source
const ( // HashKeySize is optimally 64 bytes HashKeySize = 64 // BlockKeySize is optimally 32 bytes BlockKeySize = 32 )
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate creates a random key of keysize length, and returns it in base64 encoded text.
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, o interface{})
JSONResponse writes the interface{} o as a JSON object response body.
func JSONStatusResponse ¶
func JSONStatusResponse(code int, w http.ResponseWriter, o interface{})
JSONStatusResponse writes the interface{} o as a JSON object response body with the givent http status code.
func QueryParamKeys ¶
QueryParamKeys gets the keys from a url.Values collection.
Types ¶
type DebugMiddleware ¶
type DebugMiddleware struct {
// contains filtered or unexported fields
}
DebugMiddleware provides request/response logging.
func NewDebugMiddleware ¶
func NewDebugMiddleware(w io.Writer, verbose bool) *DebugMiddleware
NewDebugMiddleware provides middleware suitable for exhaustive request/response logging.
func (*DebugMiddleware) ServeHTTP ¶
func (l *DebugMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type Seeder ¶
Seeder describes functions needed for encrypted cookies.
func NewDefaultSeeder ¶
NewDefaultSeeder creates random default values for the Seeder. This is only good for one execution run, unless the generated keys are persisted.
Click to show internal directories.
Click to hide internal directories.