Documentation
¶
Index ¶
Constants ¶
View Source
const ( SameSiteLax = "lax" SameSiteStrict = "strict" SameSiteNone = "none" )
SameSite policy values accepted by Config.SameSite (case-insensitive). An empty value defaults to Lax.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Domain string `env:"DOMAIN" json:"domain"`
CookieName string `env:"COOKIE_NAME" json:"cookieName"`
Base64EncodedHashKey string `env:"HASH_KEY" json:"base64EncodedHashKey"`
Base64EncodedBlockKey string `env:"BLOCK_KEY" json:"base64EncodedBlockKey"`
SameSite string `env:"SAME_SITE" json:"sameSite"`
Lifetime time.Duration `env:"LIFETIME" json:"lifetime"`
SecureOnly bool `env:"SECURE_ONLY" json:"secureOnly"`
}
type Manager ¶
type Manager interface {
Encode(ctx context.Context, name string, value any) (string, error)
Decode(ctx context.Context, name, value string, dst any) error
BuildCookie(ctx context.Context, name string, value any) (*http.Cookie, error)
}
func NewCookieManager ¶
func NewCookieManager(cfg *Config, tracerProvider tracing.TracerProvider) (Manager, error)
NewCookieManager returns a new Manager.
Click to show internal directories.
Click to hide internal directories.