Documentation
¶
Overview ¶
Package bestcookie implements the bestcookie algorithm and provides this to Golang's HTTP server.
__Setup__ > go get github.com/snadrus/bestcookie
__Run as Part of Builds__ go run bestcookie.go <mykeys.go >mykeys.go Only the global private "bestCookieKeys" gets replaced:
package mypkg
var bestCookieKeys = []bestcookie.Keys{}
Use in code:
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RotateKeys ¶
func RotateKeys(keys *[]Key)
RotateKeys result should be shared with all servers. Call this at build time: go run bestcookie.go <mykeys.go >mykeys.go Only the global private "bestCookieKeys" gets replaced:
package mypkg
var bestCookieKeys = []bestcookie.Keys{}
Types ¶
type BestCookie ¶
type BestCookie struct {
// contains filtered or unexported fields
}
func (*BestCookie) Middleware ¶
func (b *BestCookie) Middleware(next http.Handler) http.Handler
func (*BestCookie) UpdateCookieBytes ¶
func (b *BestCookie) UpdateCookieBytes(w http.ResponseWriter, msg interface{}) error
UpdateCookie adds or updates a cookie
Click to show internal directories.
Click to hide internal directories.