memory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memory the memory key/value store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cache is an implementation of Cache that stores bytes in in-memory.

func NewCache

func NewCache() *Cache

NewCache returns a new Cache that will store items in in-memory.

func (*Cache) Del

func (c *Cache) Del(key string)

Del removes key from the cache

func (*Cache) Get

func (c *Cache) Get(key string) ([]byte, bool)

Get returns the []byte and true, if not existing returns false.

func (*Cache) Set

func (c *Cache) Set(key string, value []byte)

Set saves []byte to the cache with key

func (*Cache) SetWithTimeout

func (c *Cache) SetWithTimeout(key string, value []byte, timeout time.Duration)

SetWithTimeout saves []byte to the cache with key

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

Cookie is an implementation of cache.Cookie that stores http.Cookie in in-memory.

func NewCookie

func NewCookie() *Cookie

NewCookie returns a new Cookie that will store cookies in in-memory.

func (*Cookie) CookieString

func (c *Cookie) CookieString(u *url.URL) string

CookieString returns the cookies string for the given URL.

func (*Cookie) Cookies

func (c *Cookie) Cookies(u *url.URL) []*http.Cookie

Cookies returns the cookies to send in a request for the given URL.

func (*Cookie) DeleteCookie

func (c *Cookie) DeleteCookie(u *url.URL)

DeleteCookie delete the cookies for the given URL.

func (*Cookie) SetCookieString

func (c *Cookie) SetCookieString(u *url.URL, cookies string)

SetCookieString handles the receipt of the cookies string in a reply for the given URL.

func (*Cookie) SetCookies

func (c *Cookie) SetCookies(u *url.URL, cookies []*http.Cookie)

SetCookies handles the receipt of the cookies in a reply for the given URL.

Jump to

Keyboard shortcuts

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