Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeValues(raw []byte) (map[string]any, error)
- func EncodeValues(values map[string]any) ([]byte, error)
- func RegisterValue(value any)
- type Flash
- type ManageableStore
- type Manager
- func (m *Manager) CSRFToken(r *http.Request) string
- func (m *Manager) CookieName() string
- func (m *Manager) Destroy(r *http.Request) error
- func (m *Manager) Lifetime() time.Duration
- func (m *Manager) Middleware(next http.Handler) http.Handler
- func (m *Manager) Renew(r *http.Request) error
- func (m *Manager) Stateless() bool
- func (m *Manager) Store() Store
- func (m *Manager) Token(r *http.Request) Token
- func (m *Manager) ValidCSRF(r *http.Request, candidate string) bool
- type MemoryStore
- func (m *MemoryStore) All(_ context.Context) ([]*Session, error)
- func (m *MemoryStore) Close()
- func (m *MemoryStore) Count(_ context.Context) (int, error)
- func (m *MemoryStore) Delete(_ context.Context, id string) error
- func (m *MemoryStore) DeleteByUserID(_ context.Context, userID string) (int, error)
- func (m *MemoryStore) Load(ctx context.Context, id string) (*Session, bool)
- func (m *MemoryStore) Save(_ context.Context, s *Session) error
- type Options
- type Record
- type Sealer
- type Session
- func (s *Session) AddFlash(kind, message string)
- func (s *Session) Clear()
- func (s *Session) ClearUser()
- func (s *Session) CreatedAt() time.Time
- func (s *Session) Delete(key string)
- func (s *Session) Destroy()
- func (s *Session) Destroyed() bool
- func (s *Session) Expired() bool
- func (s *Session) ExpiresAt() time.Time
- func (s *Session) Flashes() []Flash
- func (s *Session) Get(key string) any
- func (s *Session) GetBool(key string) bool
- func (s *Session) GetInt(key string) int
- func (s *Session) GetString(key string) string
- func (s *Session) ID() string
- func (s *Session) Keys() []string
- func (s *Session) Modified() bool
- func (s *Session) Pop(key string) any
- func (s *Session) Set(key string, value any)
- func (s *Session) SetUserID(id string)
- func (s *Session) UserID() string
- func (s *Session) Values() map[string]any
- type Store
- type Token
Constants ¶
View Source
const (
MaxCookieSize = 4000
)
Variables ¶
View Source
var ( ErrSealedTooLarge = errors.New("coyote/session: sealed session exceeds the cookie size limit") ErrSealedInvalid = errors.New("coyote/session: sealed session is missing, forged or expired") )
View Source
var ErrNoSession = errors.New("coyote/session: no session in request context")
View Source
var ErrNoSessionID = errors.New("coyote/session: refusing to store a session with no id")
Functions ¶
func RegisterValue ¶
func RegisterValue(value any)
Types ¶
type ManageableStore ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CookieName ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore(gcInterval time.Duration) *MemoryStore
func (*MemoryStore) Close ¶
func (m *MemoryStore) Close()
func (*MemoryStore) DeleteByUserID ¶
type Record ¶
Click to show internal directories.
Click to hide internal directories.