cookies

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerCookieVersion = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	ClientCookie []byte
	ServerCookie []byte
}

func DecodeEdns0Cookie

func DecodeEdns0Cookie(ec *dns.EDNS0_COOKIE) (*Cookie, error)

func (*Cookie) Edns0

func (c *Cookie) Edns0() *dns.EDNS0_COOKIE

type CookieGenerator

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

func NewCookieGenerator

func NewCookieGenerator(key []byte) (*CookieGenerator, error)

func (*CookieGenerator) GenerateCookie

func (cg *CookieGenerator) GenerateCookie(clientCookie []byte, clientIP net.IP) (*Cookie, error)

func (*CookieGenerator) ValidateCookie

func (cg *CookieGenerator) ValidateCookie(cookie *Cookie, clientIP net.IP) error

type ServerCookie

type ServerCookie []byte

Jump to

Keyboard shortcuts

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