cookies

package
v0.0.1-alpha-c Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CALLBACK_STATE = "soarca_gui_state"
	CALLBACK_NONCE = "soarca_gui_nonce"
	USER_TOKEN     = "soarca_token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	CookieType CookieType
	Value      string
}

func NewCookie

func NewCookie(cookieType CookieType, value string) (Cookie, error)

func (*Cookie) SetCookieValue

func (cookie *Cookie) SetCookieValue(value string)

type CookieJar

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

func NewCookieJar

func NewCookieJar(secret []byte, encryptionKey []byte) *CookieJar

func (*CookieJar) Delete

func (cj *CookieJar) Delete(gc *gin.Context, cookieType CookieType) error

func (*CookieJar) Get

func (cj *CookieJar) Get(gc *gin.Context, cookieType CookieType) (value string, isNew bool, err error)

func (*CookieJar) Store

func (cj *CookieJar) Store(gc *gin.Context, cookie Cookie) error

type CookieType

type CookieType uint
const (
	State CookieType = iota
	Nonce
	Token
)

type ICookieJar

type ICookieJar interface {
	Store(context *gin.Context, cookie Cookie) error
	Get(gc *gin.Context, cookieType CookieType) (value string, isNew bool, err error)
	Delete(context *gin.Context, cookieType CookieType) error
}

Jump to

Keyboard shortcuts

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