sessions: Index | Files

package transport

import ""


Package Files

service.go service_interface.go service_util.go


const (
    // DefaultCookieName is the default cookie name used
    DefaultCookieName = "session"
    // DefaultCookiePath is the default cookie path
    DefaultCookiePath = "/"


var ErrNoSessionOnRequest = errors.New("no session on request")

ErrNoSessionOnRequest is thrown when a session is not found on a request

type Options Uses

type Options struct {
    CookieName string
    CookiePath string
    HTTPOnly   bool
    Secure     bool

Options defines the behavior of the transport service

type Service Uses

type Service struct {
    // contains filtered or unexported fields

Service writes sessions on responseWriters and reads sessions from requests

func New Uses

func New(options Options) *Service

New returns a new transport service

func (*Service) DeleteSessionFromResponse Uses

func (s *Service) DeleteSessionFromResponse(w http.ResponseWriter) error

DeleteSessionFromResponse deletes a user session from a responseWriter

func (*Service) FetchSessionIDFromRequest Uses

func (s *Service) FetchSessionIDFromRequest(r *http.Request) (string, error)

FetchSessionIDFromRequest retrieves a signed session id from a request

func (*Service) SetSessionOnResponse Uses

func (s *Service) SetSessionOnResponse(signedSessionID string, userSession *user.Session, w http.ResponseWriter) error

SetSessionOnResponse sets a signed session id and a user session on a responseWriter

type ServiceInterface Uses

type ServiceInterface interface {
    SetSessionOnResponse(session string, userSession *user.Session, w http.ResponseWriter) error
    DeleteSessionFromResponse(w http.ResponseWriter) error
    FetchSessionIDFromRequest(r *http.Request) (string, error)

ServiceInterface defines the methods performed by the transport service

Package transport imports 4 packages (graph) and is imported by 1 packages. Updated 2017-05-11. Refresh now. Tools for package owners.