cache

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	GetItem(key string) (interface{}, error)
	SetItem(key string, value interface{}, exp time.Duration) error
	RemoveItem(key string) error
	Clear() error
	Length() (uint, error)
}

type Mem

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

func NewMemoryCache

func NewMemoryCache() Mem

func (Mem) Clear

func (m Mem) Clear() error

func (Mem) GetItem

func (m Mem) GetItem(key string) (interface{}, error)

func (Mem) Length

func (m Mem) Length() (uint, error)

func (Mem) RemoveItem

func (m Mem) RemoveItem(key string) error

func (Mem) SetItem

func (m Mem) SetItem(key string, value interface{}, exp time.Duration) error

type Redis

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

func NewRedisCache

func NewRedisCache(addr string, password string) Redis

func (Redis) Clear

func (m Redis) Clear() error

func (Redis) GetItem

func (m Redis) GetItem(key string) (interface{}, error)

func (Redis) Length

func (m Redis) Length() (uint, error)

func (Redis) RemoveItem

func (m Redis) RemoveItem(key string) error

func (Redis) SetItem

func (m Redis) SetItem(key string, value interface{}, exp time.Duration) error

Jump to

Keyboard shortcuts

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