MCPcopy Index your code
hub / github.com/apache/answer / SetAdminUserCacheInfo

Method SetAdminUserCacheInfo

internal/repo/auth/auth.go:171–183  ·  view source on GitHub ↗

SetAdminUserCacheInfo set admin user cache info

(ctx context.Context, accessToken string, userInfo *entity.UserCacheInfo)

Source from the content-addressed store, hash-verified

169
170// SetAdminUserCacheInfo set admin user cache info
171func (ar *authRepo) SetAdminUserCacheInfo(ctx context.Context, accessToken string, userInfo *entity.UserCacheInfo) (err error) {
172 userInfoCache, err := json.Marshal(userInfo)
173 if err != nil {
174 return err
175 }
176
177 err = ar.data.Cache.SetString(ctx, constant.AdminTokenCacheKey+accessToken, string(userInfoCache),
178 constant.AdminTokenCacheTime)
179 if err != nil {
180 return errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
181 }
182 return nil
183}
184
185// RemoveAdminUserCacheInfo remove admin user cache info
186func (ar *authRepo) RemoveAdminUserCacheInfo(ctx context.Context, accessToken string) (err error) {

Callers

nothing calls this directly

Calls 1

SetStringMethod · 0.80

Tested by

no test coverage detected