{"modulePath":"github.com/liquidgecka/blobby","version":"v0.0.0-20261108055455-e9a390ceacc7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cookie\n\n## Types\n\n```go\ntype CookieTool struct {\n\t// Returns a list of cipher.Block object that should be used for\n\t// processing cookies. Cookies will be decrypted with all the keys\n\t// in order to find one that is valid and will be encrypted with the\n\t// first in the list. This allows rotation of keys without disruption.\n\tAESKeys func(context.Context) ([]cipher.Block, error)\n}\n```\nHandles the encrypting and decrypting of data in cookies.\n\n```go\nfunc (c *CookieTool) Decode(\n\tctx context.Context,\n\tcookie string,\n\tv interface{},\n) error\n```\nDecodes the given cookie contents into the given interface value. If the cookie is not valid or can not be decoded then an error will be returned.\n\n```go\nfunc (c *CookieTool) Encode(\n\tctx context.Context,\n\tv interface{},\n) (\n\tstring,\n\terror,\n)\n```\nLike decodeCookie except this is used for encoding.\n\n```go\ntype Time struct {\n\ttime.Time\n}\n```\nActs like a time.Time object, but encodes to and from a unix epoch to save space. Because this converts to float and back it will lose precision in the sub-second values, typically at most in the micro second range.\n\n```go\nfunc (t *Time) MarshalText() ([]byte, error)\n```\n\n```go\nfunc (t *Time) UnmarshalText(raw []byte) error\n```\n\n","path":"github.com/liquidgecka/blobby/httpserver/cookie","name":"cookie","synopsis":"","isRedistributable":true}
