Documentation
¶
Index ¶
- Constants
- type ClientReadableCookie
- func (c *ClientReadableCookie) DeleteWithProxy(rp *response.Proxy)
- func (c *ClientReadableCookie) DeleteWithWriter(w http.ResponseWriter)
- func (c *ClientReadableCookie) Get(r *http.Request) (T, error)
- func (c *ClientReadableCookie) Name() string
- func (c *ClientReadableCookie) New(value T) *http.Cookie
- func (c *ClientReadableCookie) NewDeletion() *http.Cookie
- func (c *ClientReadableCookie) SetWithProxy(rp *response.Proxy, value T)
- func (c *ClientReadableCookie) SetWithWriter(w http.ResponseWriter, value T)
- type ClientReadableCookieConfig
- type ClientReadableCookieNonHostOnly
- func (c *ClientReadableCookieNonHostOnly) DeleteWithProxy(rp *response.Proxy)
- func (c *ClientReadableCookieNonHostOnly) DeleteWithWriter(w http.ResponseWriter)
- func (c *ClientReadableCookieNonHostOnly) Get(r *http.Request) (T, error)
- func (c *ClientReadableCookieNonHostOnly) Name() string
- func (c *ClientReadableCookieNonHostOnly) New(value T) *http.Cookie
- func (c *ClientReadableCookieNonHostOnly) NewDeletion() *http.Cookie
- func (c *ClientReadableCookieNonHostOnly) SetWithProxy(rp *response.Proxy, value T)
- func (c *ClientReadableCookieNonHostOnly) SetWithWriter(w http.ResponseWriter, value T)
- type ClientReadableCookieNonHostOnlyConfig
- type HttpOnlyOption
- type Manager
- type ManagerConfig
- type PartitionOption
- type SameSite
- type SecureCookie
- func (c *SecureCookie) DeleteWithProxy(rp *response.Proxy)
- func (c *SecureCookie) DeleteWithWriter(w http.ResponseWriter)
- func (c *SecureCookie) Get(r *http.Request) (T, error)
- func (c *SecureCookie) Name() string
- func (c *SecureCookie) New(data T) (*http.Cookie, error)
- func (c *SecureCookie) NewDeletion() *http.Cookie
- func (c *SecureCookie) SetWithProxy(rp *response.Proxy, value T) error
- func (c *SecureCookie) SetWithWriter(w http.ResponseWriter, value T) error
- type SecureCookieConfig
- type SecureCookieNonHostOnly
- func (c *SecureCookieNonHostOnly) DeleteWithProxy(rp *response.Proxy)
- func (c *SecureCookieNonHostOnly) DeleteWithWriter(w http.ResponseWriter)
- func (c *SecureCookieNonHostOnly) Get(r *http.Request) (T, error)
- func (c *SecureCookieNonHostOnly) Name() string
- func (c *SecureCookieNonHostOnly) New(data T) (*http.Cookie, error)
- func (c *SecureCookieNonHostOnly) NewDeletion() *http.Cookie
- func (c *SecureCookieNonHostOnly) SetWithProxy(rp *response.Proxy, value T) error
- func (c *SecureCookieNonHostOnly) SetWithWriter(w http.ResponseWriter, value T) error
- type SecureCookieNonHostOnlyConfig
Constants ¶
View Source
const ( SameSiteLaxMode SameSite = SameSite(http.SameSiteLaxMode) SameSiteStrictMode SameSite = SameSite(http.SameSiteStrictMode) PartitionTrue PartitionOption = 1 // Explicitly enable partitioning PartitionFalse PartitionOption = 2 // Explicitly disable partitioning HttpOnlyTrue HttpOnlyOption = 1 // Explicitly enable HttpOnly HttpOnlyFalse HttpOnlyOption = 2 // Explicitly disable HttpOnly )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientReadableCookie ¶
type ClientReadableCookie[T ~string] struct { // contains filtered or unexported fields }
func NewClientReadableCookie ¶
func NewClientReadableCookie[T ~string](cfg ClientReadableCookieConfig) *ClientReadableCookie[T]
Panics if you fail to provide a Manager or Name via config struct.
func (*ClientReadableCookie) DeleteWithProxy ¶
func (*ClientReadableCookie) DeleteWithWriter ¶
func (c *ClientReadableCookie) DeleteWithWriter(w http.ResponseWriter)
func (*ClientReadableCookie) NewDeletion ¶
func (*ClientReadableCookie) SetWithProxy ¶
func (*ClientReadableCookie) SetWithWriter ¶
func (c *ClientReadableCookie) SetWithWriter(w http.ResponseWriter, value T)
type ClientReadableCookieNonHostOnly ¶
type ClientReadableCookieNonHostOnly[T ~string] struct { // contains filtered or unexported fields }
func NewClientReadableCookieNonHostOnly ¶
func NewClientReadableCookieNonHostOnly[T ~string](cfg ClientReadableCookieNonHostOnlyConfig) *ClientReadableCookieNonHostOnly[T]
Panics if you fail to provide a Manager or Name via config struct.
func (*ClientReadableCookieNonHostOnly) DeleteWithProxy ¶
func (*ClientReadableCookieNonHostOnly) DeleteWithWriter ¶
func (c *ClientReadableCookieNonHostOnly) DeleteWithWriter(w http.ResponseWriter)
func (*ClientReadableCookieNonHostOnly) Name ¶
func (c *ClientReadableCookieNonHostOnly) Name() string
func (*ClientReadableCookieNonHostOnly) NewDeletion ¶
func (*ClientReadableCookieNonHostOnly) SetWithProxy ¶
func (*ClientReadableCookieNonHostOnly) SetWithWriter ¶
func (c *ClientReadableCookieNonHostOnly) SetWithWriter(w http.ResponseWriter, value T)
type HttpOnlyOption ¶
type HttpOnlyOption int
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(cfg ManagerConfig) *Manager
type ManagerConfig ¶
type ManagerConfig struct {
GetKeyset func() *keyset.Keyset
GetIsDev func() bool // Optional. Resolves to false if nil.
// The manager's default SameSite setting.
DefaultSameSite SameSite
// The manager's default for cookie partitioning.
DefaultPartition PartitionOption
// The manager's default for the HttpOnly flag on secure cookies.
DefaultHttpOnly HttpOnlyOption
}
type PartitionOption ¶
type PartitionOption int
type SecureCookie ¶
type SecureCookie[T any] struct { // contains filtered or unexported fields }
func NewSecureCookie ¶
func NewSecureCookie[T any](cfg SecureCookieConfig) *SecureCookie[T]
Panics if you fail to provide a Manager or Name via config struct.
func (*SecureCookie) DeleteWithProxy ¶
func (*SecureCookie) DeleteWithWriter ¶
func (c *SecureCookie) DeleteWithWriter(w http.ResponseWriter)
func (*SecureCookie) NewDeletion ¶
func (*SecureCookie) SetWithProxy ¶
func (*SecureCookie) SetWithWriter ¶
func (c *SecureCookie) SetWithWriter(w http.ResponseWriter, value T) error
type SecureCookieConfig ¶
type SecureCookieConfig struct {
Manager *Manager // Required.
// Required. Do not prefix the name with "__Host-". Prefixing is handled internally.
// Final cookie name will be "__{Host|Dev}-{Name}".
Name string
TTL time.Duration
SameSite SameSite
Partition PartitionOption
HttpOnly HttpOnlyOption
}
type SecureCookieNonHostOnly ¶
type SecureCookieNonHostOnly[T any] struct { // contains filtered or unexported fields }
func NewSecureCookieNonHostOnly ¶
func NewSecureCookieNonHostOnly[T any](cfg SecureCookieNonHostOnlyConfig) *SecureCookieNonHostOnly[T]
Panics if you fail to provide a Manager or Name via config struct.
func (*SecureCookieNonHostOnly) DeleteWithProxy ¶
func (*SecureCookieNonHostOnly) DeleteWithWriter ¶
func (c *SecureCookieNonHostOnly) DeleteWithWriter(w http.ResponseWriter)
func (*SecureCookieNonHostOnly) NewDeletion ¶
func (*SecureCookieNonHostOnly) SetWithProxy ¶
func (*SecureCookieNonHostOnly) SetWithWriter ¶
func (c *SecureCookieNonHostOnly) SetWithWriter(w http.ResponseWriter, value T) error
type SecureCookieNonHostOnlyConfig ¶
type SecureCookieNonHostOnlyConfig struct {
Manager *Manager // Required.
Name string
TTL time.Duration
SameSite SameSite
Partition PartitionOption
Path string
Domain string
HttpOnly HttpOnlyOption
}
Click to show internal directories.
Click to hide internal directories.