Help us shape the future of Go! Take the 2026 Go Developer Survey

values

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provides = wire.NewSet(
	wire.Struct(new(Controller), "*"),
	wire.Struct(new(Service), "*"),
)
View Source
var Secret = map[string]bool{
	"tencent_secret_key":        true,
	"feishu_app_secret":         true,
	"feishu_encrypt_key":        true,
	"feishu_verification_token": true,
	"email_password":            true,
	"openapi_secret":            true,
}

Secret 密文配置

Functions

This section is empty.

Types

type Controller

type Controller struct {
	ValuesService *Service
}

func (*Controller) Get

func (x *Controller) Get(ctx context.Context, c *app.RequestContext)

Get 获取动态配置 @router /values [GET]

func (*Controller) Remove

func (x *Controller) Remove(ctx context.Context, c *app.RequestContext)

Remove 移除动态配置 @router /values/:id [DELETE]

func (*Controller) Set

func (x *Controller) Set(ctx context.Context, c *app.RequestContext)

Set 设置动态配置 @router /values [PATCH]

type Service

type Service struct {
	Values *common.Values
	Redis  *redis.Client
	Nats   *nats.Conn
}

func (*Service) Get

func (x *Service) Get(keys ...string) (data map[string]interface{})

Get 获取动态配置

func (*Service) Key

func (x *Service) Key() string

Key 命名

func (*Service) Load

func (x *Service) Load(ctx context.Context) (err error)

Load 载入配置

func (*Service) Remove

func (x *Service) Remove(ctx context.Context, key string) (err error)

Remove 移除动态配置

func (*Service) Set

func (x *Service) Set(ctx context.Context, data map[string]interface{}) (err error)

Set 设置动态配置

func (*Service) Sync

func (x *Service) Sync(ctx context.Context) (err error)

Sync 同步节点动态配置

func (*Service) Update

func (x *Service) Update(ctx context.Context) (err error)

Update 更新配置

Jump to

Keyboard shortcuts

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