cache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cache @Description: 缓存包,用来调用缓存组件

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GobToBytes

func GobToBytes(val interface{}) []byte

func GobToValue

func GobToValue(data []byte, val interface{})

Types

type Bolt

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

func NewBolt

func NewBolt() *Bolt

func (*Bolt) Add

func (c *Bolt) Add(bucket string)

func (*Bolt) Close

func (c *Bolt) Close()

func (*Bolt) Get

func (c *Bolt) Get(bucket string, key, val interface{}) error

func (*Bolt) Open

func (c *Bolt) Open(path string)

func (*Bolt) Put

func (c *Bolt) Put(bucket string, key, val interface{}, ttl int64)

type Cache

type Cache interface {
	Open(path string)
	Close()
	Add(bucket string)
	Put(bucket string, key, val interface{}, ttl int64)
	Get(bucket string, key, val interface{}) error
}

Jump to

Keyboard shortcuts

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