tinycache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

* @Author: liziwei01 * @Date: 2022-03-04 15:43:21 * @LastEditors: liziwei01 * @LastEditTime: 2023-11-01 11:18:41 * @Description: file content

* @Author: liziwei01 * @Date: 2023-05-09 23:32:35 * @LastEditors: liziwei01 * @LastEditTime: 2023-05-09 23:58:24 * @Description: file content

* @Author: liziwei01 * @Date: 2023-05-09 23:35:17 * @LastEditors: liziwei01 * @LastEditTime: 2023-05-09 23:36:49 * @Description: file content

* @Author: liziwei01 * @Date: 2021-07-23 15:23:10 * @LastEditors: liziwei01 * @LastEditTime: 2023-05-09 23:58:15 * @Description: tinycache * @FilePath: /gdp-config-platform/library/tinycaches/tinycache.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetStr 获取value
	Get(key string) string
	// Set 将字符串值 value 关联到 key
	// 如果 key 已经存在, SET 将覆盖旧值 无视类型
	// 过期时间为 nanoseconds 纳秒
	Set(key string, value string, expireTime ...time.Duration)
	// contains filtered or unexported methods
}

func GetClient

func GetClient(ctx context.Context, serviceName string) (Client, error)

*

  • @description:
  • @param {context.Context} ctx
  • @param {string} serviceName
  • @return {*}

func New

func New(config *Config) Client

type Config

type Config struct {
	// Service的名字, 必选
	Name string

	// 各种自定义的参数, 全部非必选
	// 超时
	ExpireTime int64
}

Config 配置

Jump to

Keyboard shortcuts

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