lache

package module
v0.0.0-...-5c90f72 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 3 Imported by: 0

README

lache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Driver Driver
}

func New

func New(t DriverType, options any) *Client

func (*Client) Delete

func (client *Client) Delete(key string) (ok bool)

func (*Client) Get

func (client *Client) Get(key string) (result any, ok bool)

func (*Client) GetT

func (client *Client) GetT(key string, result any) (ok bool)

func (*Client) Set

func (client *Client) Set(key string, value any, expiration time.Duration) (ok bool)

type Driver

type Driver interface {
	Get(key string) (result any, ok bool)
	GetT(key string, result any) (ok bool)
	Set(key string, value any, expiration time.Duration) (ok bool)
	Delete(key string) (ok bool)
}

type DriverType

type DriverType int
const (
	Local        DriverType = 1
	Redis        DriverType = 2
	RedisCluster DriverType = 3
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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