cache

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key string, value string) error
	Get(key string) (string, error)
	Delete(key string) error
	SetExpiration(expiration time.Duration) Cache
}

func NewMemoryCache

func NewMemoryCache() Cache

type MemoryCache

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

func (*MemoryCache) Delete

func (c *MemoryCache) Delete(key string) error

func (*MemoryCache) Get

func (c *MemoryCache) Get(key string) (string, error)

func (*MemoryCache) Set

func (c *MemoryCache) Set(key string, value string) error

func (*MemoryCache) SetExpiration added in v0.1.8

func (c *MemoryCache) SetExpiration(expiration time.Duration) Cache

type MemoryCacheOptions added in v0.1.8

type MemoryCacheOptions struct {
	ExpireAfter *time.Duration
}

Jump to

Keyboard shortcuts

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