seed: github.com/qlova/seed/user/session Index | Files

package session

import "github.com/qlova/seed/user/session"

Index

Package Files

crypto.go session.go

func Decrypt Uses

func Decrypt(data string) []byte

func Encrypt Uses

func Encrypt(data []byte) string

Encrypt encrypts data with the session encryption scheme.

func Key Uses

func Key() (key [32]byte)

Key returns the key used by session to encrypt data. Reads key from SESSION_KEY env. Will create a key and store it in seed.Dir if it env is not set.

type String Uses

type String Value

String is a string that is securely stored within a session cookie.

func NewString Uses

func NewString(name ...string) String

NewString returns a new session string.

func (String) For Uses

func (s String) For(u user.Ctx) string

For gets the session String value for the specified user.

func (String) SetFor Uses

func (s String) SetFor(u user.Ctx, value string)

SetFor sets the session String value for the specified user.

type Value Uses

type Value struct {
    // contains filtered or unexported fields
}

Value is a session value.

Package session imports 16 packages (graph). Updated 2020-04-10. Refresh now. Tools for package owners.