db

package
v0.0.0-...-b99c6ec Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package db 用于初始化和管理 Badger 数据库连接。

Index

Constants

This section is empty.

Variables

DB 是全局的 Badger 数据库实例

Functions

func Del

func Del(key string)

Del 删除Key

func Get

func Get(key string) (value string, ok bool)

Get 根据Key获取Value

func Init

func Init()

Init 初始化 Badger 数据库连接并启动后台垃圾回收

func Set

func Set(key, value string, ttl ...time.Duration)

Set 设置键值对,ttl是超时时间(可选)

func Stop

func Stop()

Stop 关闭数据库连接

Types

This section is empty.

Jump to

Keyboard shortcuts

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