cache

package
v0.0.0-...-3b303fa Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is our struct for cache store.

func New

func New() *Store

New initializes a new cache store.

func (*Store) Close

func (s *Store) Close()

Close method clear and then close the cache store.

func (*Store) Delete

func (s *Store) Delete(key string)

Delete method to delete a key from cahce.

func (*Store) Get

func (s *Store) Get(key string) (string, bool)

Get method to retrieve the value of a key. If not present, returns false.

func (*Store) Invalidate

func (s *Store) Invalidate(tags []string)

Invalidate method to invalidate cache with given tags.

func (*Store) SetByTags

func (s *Store) SetByTags(key, value string, expiry time.Duration, tags []string)

SetByTags method to set cache by given tags.

Jump to

Keyboard shortcuts

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