Documentation ¶
Index ¶
- type ProtobufEncoder
- type Store
- func (s *Store) Delete(w http.ResponseWriter) error
- func (s *Store) Get(req *http.Request, obj interface{}) error
- func (s *Store) Set(w http.ResponseWriter, obj interface{}) error
- func (s *Store) WithSecure(secure bool) *Store
- func (s *Store) WithSerializer(serializer securecookie.Serializer) *Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProtobufEncoder ¶
type ProtobufEncoder struct{}
ProtobufEncoder is a securecookie.Serializer that deals with protobuf messages.
func (*ProtobufEncoder) Deserialize ¶
func (p *ProtobufEncoder) Deserialize(src []byte, dst interface{}) error
func (*ProtobufEncoder) Serialize ¶
func (p *ProtobufEncoder) Serialize(src interface{}) ([]byte, error)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A SessionStore is a slightly simpler version of gorilla sessions.Store, without the global session registry, serializing specific types rather than generic interfaces. Each Store manages a single session cookie.
func NewProtobuf ¶
NewProtobuf returns a new Store with protobuf encoder.
func (*Store) Delete ¶
func (s *Store) Delete(w http.ResponseWriter) error
Delete the current session cookie.
func (*Store) Get ¶
Get decodes the current session, if any, into 'obj'.
func (*Store) Set ¶
func (s *Store) Set(w http.ResponseWriter, obj interface{}) error
Set the session value.
func (*Store) WithSecure ¶
WithSecure allows to explicitly toggle the 'Secure' bit on cookies.
func (*Store) WithSerializer ¶
func (s *Store) WithSerializer(serializer securecookie.Serializer) *Store
WithSerializer allows changing the default JSON serializer.
Click to show internal directories.
Click to hide internal directories.