MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / StoreVCode

Method StoreVCode

internal/repository/cache/sms.go:63–66  ·  view source on GitHub ↗

StoreVCode 存储短信验证码

(ctx context.Context, smsID string, number string, vCode string)

Source from the content-addressed store, hash-verified

61
62// StoreVCode 存储短信验证码
63func (s *smsCache) StoreVCode(ctx context.Context, smsID string, number string, vCode string) error {
64 key := getVCodeKey(smsID, number)
65 return s.client.Set(ctx, key, vCode, time.Minute*10).Err()
66}
67
68// SetNX 设置一个不存在的key
69func (s *smsCache) SetNX(ctx context.Context, number string, value interface{}, expiration time.Duration) (*redis.BoolCmd, error) {

Callers

nothing calls this directly

Calls 2

getVCodeKeyFunction · 0.85
SetMethod · 0.65

Tested by

no test coverage detected