settings

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package settings 为公开与内部配置共用分组Hash缓存。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Redis  redis.UniversalClient
	Prefix string
}

Store 复用应用的Redis连接与命名空间,不另存配置副本。

func (*Store) Read

func (s *Store) Read(ctx context.Context, db *gorm.DB, group, field string) (json.RawMessage, error)

Read 返回组内JSON字段;缺失字段返回nil,缺失记录保留数据库错误。

func (*Store) Write

func (s *Store) Write(ctx context.Context, group string, values map[string]json.RawMessage, revision int64) error

Write 只接受较新的配置版本,避免多实例并发时旧值回写。

Jump to

Keyboard shortcuts

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