auth

package
v0.5.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CookieName = "gopherink_session"

Variables

This section is empty.

Functions

func ClearSession

func ClearSession(w http.ResponseWriter)

func ClearSessionWithOptions

func ClearSessionWithOptions(w http.ResponseWriter, options CookieOptions)

func ParseSession

func ParseSession(r *http.Request, secret string) (int64, bool)

func ParseSessionWithOptions

func ParseSessionWithOptions(r *http.Request, secret string, options CookieOptions) (int64, bool)

func SetSession

func SetSession(w http.ResponseWriter, secret string, uid int64)

func SetSessionWithOptions

func SetSessionWithOptions(w http.ResponseWriter, secret string, uid int64, options CookieOptions)

func SetVersionedSessionWithOptions

func SetVersionedSessionWithOptions(w http.ResponseWriter, secret string, uid int64, version string, options CookieOptions)

Types

type CookieOptions

type CookieOptions struct {
	Prefix   string
	Secure   bool
	HTTPOnly bool
	SameSite http.SameSite
}

func (CookieOptions) Name

func (o CookieOptions) Name(base string) string

type Session

type Session struct {
	UID     int64
	Expires int64
	Version string
}

func ParseVersionedSessionWithOptions

func ParseVersionedSessionWithOptions(r *http.Request, secret string, options CookieOptions) (Session, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL